-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
Or does this belogn into https://symfony.com/doc/current/profiler.html ? Learned from https://stackoverflow.com/questions/26436987/symfony-stopwatch-events-not-appearing-in-profiler-timeline |
There was a problem hiding this 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
.
components/stopwatch.rst
Outdated
Usage in symfony | ||
---------------- | ||
|
||
In a Controller, do: |
There was a problem hiding this comment.
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.
components/stopwatch.rst
Outdated
$stopwatch = $this->get('debug.stopwatch'); | ||
$stopwatch->start('anEvent'); | ||
|
||
Or inject `Symfony\Component\Stopwatch\Stopwatch` by autowiring. |
There was a problem hiding this comment.
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.
5dc8777
to
e34ce40
Compare
I am not a great author, but I tried a separate article anyway in #10332. ( |
I think this should be closed in favour of #10332. |
closing here in favour of #10332 |
No description provided.