From 6ffd199d12763b837036e77fdaf5ece3518eef8e Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 29 Sep 2021 01:38:28 +0200 Subject: [PATCH] Documenting the __root__ section Finally closes the (already closed) https://github.com/symfony/symfony-docs/issues/13987 The info is taken from @stof at https://github.com/symfony/symfony/issues/37630#issuecomment-661969184 --- performance.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/performance.rst b/performance.rst index 0e980a2550d..1d786972988 100644 --- a/performance.rst +++ b/performance.rst @@ -327,6 +327,15 @@ Sections are a way to split the profile timeline into groups. Example:: $this->stopwatch->start('processing-file'); $this->stopwatch->stopSection('parsing'); +All events that don't belong to any named section are added to the special section +``__root__``. This way you can get all stopwatch events, even if you don't know +their names:: + + foreach($this->stopwatch->getSectionEvents('__root__') as $event) { + echo (string) $event; + } + + Learn more ----------