Skip to content

Commit 0487482

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [Console] Added documentation about command profiling
2 parents c64e7e7 + b434faa commit 0487482

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

console.rst

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

592+
Profiling Commands
593+
------------------
594+
595+
Symfony allows to profile the execution of any command, including yours. First,
596+
make sure that the :ref:`debug mode <debug-mode>` and the :doc:`profiler </profiler>`
597+
are enabled. Then, add the ``--profile`` option when running the command:
598+
599+
.. code-block:: terminal
600+
601+
$ php bin/console --profile app:my-command
602+
603+
Symfony will now collect data about the command execution, which is helpful to
604+
debug errors or check other issues. When the command execution is over, the
605+
profile is accessible through the web page of the profiler.
606+
607+
.. tip::
608+
609+
If you run the command in verbose mode (adding the ``-v`` option), Symfony
610+
will display in the output a clickable link to the command profile (if your
611+
terminal supports links). If you run it in debug verbosity (``-vvv``) you'll
612+
also see the time and memory consumed by the command.
613+
614+
.. versionadded:: 6.4
615+
616+
The ``--profile`` option was introduced in Symfony 6.4.
617+
592618
Learn More
593619
----------
594620

0 commit comments

Comments
 (0)