Skip to content

write how to use the stopwatch in symfony profiler #9320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

SimonHeimberg
Copy link
Contributor

No description provided.

@SimonHeimberg
Copy link
Contributor Author

@xabbuh xabbuh added this to the 2.7 milestone Feb 23, 2018
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I do like to make this a sub article in the profiler guide. This is not so much about the Stopwatch component, but more about the usage of that component in the framework. As such, it belongs to the guides.

Are you willing to create a new article, or shall we take of this PR (keeping your commit for credits)? If you want to create the article, create a new file in /profiler/ and reference it in /profiler.rst.

Usage in symfony
----------------

In a Controller, do:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a double colon (::) in order to mark the next block as PHP code block.

$stopwatch = $this->get('debug.stopwatch');
$stopwatch->start('anEvent');

Or inject `Symfony\Component\Stopwatch\Stopwatch` by autowiring.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use :class:`Symfony\\Component\\Stopwatch\\Stopwatch` to (a) render it correctly and (b) directly reference it's API documentation.

I think the line below may also be added directly to this paragraph.

@SimonHeimberg
Copy link
Contributor Author

SimonHeimberg commented Sep 12, 2018

I am not a great author, but I tried a separate article anyway in #10332. (profiler.rst includes the article automatically, but must be updated when merging into 4.x)

@ndench
Copy link
Contributor

ndench commented Nov 14, 2018

I think this should be closed in favour of #10332.

@xabbuh xabbuh modified the milestones: 2.8, 3.4 Nov 28, 2018
@xabbuh
Copy link
Member

xabbuh commented Nov 28, 2018

closing here in favour of #10332

@xabbuh xabbuh closed this Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants