Skip to content

Commit 8688b34

Browse files
committed
minor #19265 [Console] Added documentation about command profiling (maelanleborgne)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Console] Added documentation about command profiling I just noticed the new `--profile` option wasn't documented (only on [this blog post](https://symfony.com/blog/new-in-symfony-6-4-command-profiler)) yet, so here's a PR with just some minimal info added to the console page. Commits ------- 4945d0a [Console] Added documentation about command profiling
2 parents 82533f0 + 4945d0a commit 8688b34

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

console.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,36 @@ Using Events And Handling Signals
619619
When a command is running, many events are dispatched, one of them allows to
620620
react to signals, read more in :doc:`this section </components/console/events>`.
621621

622+
Profiling Commands
623+
------------------
624+
625+
When debug mode and the profiler are enabled, you can run a command with the
626+
``--profile`` option. Symfony will then collect data about the command execution.
627+
When the execution is over, the profile is accessible through the web page of
628+
the :doc:`Symfony Profiler </profiler>`.
629+
630+
.. tip::
631+
632+
If you run the command in verbose mode (``-v``), Symfony will display
633+
in the output a clickable link to the command profile (if your terminal
634+
supports links). If you run it in debug verbosity (``-vvv``) you'll
635+
also see the time and memory consumed by the command.
636+
637+
.. code-block:: terminal
638+
639+
$ php bin/console --profile -v app:my-command
640+
...
641+
642+
[OK] Command successful !
643+
644+
See profile f4ef63 # <- this is a clickable link if your terminal supports it
645+
646+
```
647+
648+
.. versionadded:: 6.4
649+
650+
The ``--profile`` option was introduced in Symfony 6.4.
651+
622652
Learn More
623653
----------
624654

0 commit comments

Comments
 (0)