From 5f0160039562e37db5091defda6d2e50571b6aa2 Mon Sep 17 00:00:00 2001 From: Simon Heimberg Date: Fri, 23 Feb 2018 15:28:20 +0100 Subject: [PATCH 1/3] extend profiler article about how to use the stopwatch --- profiler/stopwatch.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 profiler/stopwatch.rst diff --git a/profiler/stopwatch.rst b/profiler/stopwatch.rst new file mode 100644 index 00000000000..bd78adb6dfa --- /dev/null +++ b/profiler/stopwatch.rst @@ -0,0 +1,17 @@ +.. index:: + single: Profiling; Stopwatch + +How to show custom timing +========================= + +Inject :class:`Symfony\\Component\\Stopwatch\\Stopwatch` by autowiring. Or do ``$stopwatch = $this->get('debug.stopwatch');`` in a Controller. + +All timing mesurements done by this stopwatch are shown in the profiler on the page performance. + +short example:: + + $stopwatch->start('anEvent', 'customCategory'); + $stopwatch->lapse('anEvent'); + $stopwatch->stop('anEvent'); + +:doc:`/component/stopwatch` explains the methods in more details. From f6e13788590b51374925f65cc5fb410fa3ccd55f Mon Sep 17 00:00:00 2001 From: SimonHeimberg Date: Thu, 29 Nov 2018 22:47:34 +0100 Subject: [PATCH 2/3] reference stopwatch in profiler article --- _build/redirection_map | 1 + 1 file changed, 1 insertion(+) diff --git a/_build/redirection_map b/_build/redirection_map index 3ebfecff681..3ce81114179 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -190,6 +190,7 @@ /cookbook/profiler/matchers /profiler/matchers /cookbook/profiler/profiling_data /profiler/profiling_data /cookbook/profiler/storage /profiler/storage +/cookbook/profiler/stopwatch /profiler/stopwatch /cookbook/psr7 /components/psr7 /cookbook/request/index /request /cookbook/request/load_balancer_reverse_proxy /deployment/proxies From 93b6111d58c9bb18a88c3b583cde0045530aa003 Mon Sep 17 00:00:00 2001 From: SimonHeimberg Date: Thu, 29 Nov 2018 23:27:37 +0100 Subject: [PATCH 3/3] fix typo in reference stopwatch article --- profiler/stopwatch.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiler/stopwatch.rst b/profiler/stopwatch.rst index bd78adb6dfa..8c02e77f403 100644 --- a/profiler/stopwatch.rst +++ b/profiler/stopwatch.rst @@ -14,4 +14,4 @@ short example:: $stopwatch->lapse('anEvent'); $stopwatch->stop('anEvent'); -:doc:`/component/stopwatch` explains the methods in more details. +:doc:`/components/stopwatch` explains the methods in more details.