Skip to content

Commit 4945d0a

Browse files
maelanleborgnejaviereguiluz
authored andcommitted
[Console] Added documentation about command profiling
1 parent 3e0c7e1 commit 4945d0a

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)