File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -589,6 +589,32 @@ Using Events And Handling Signals
589589When a command is running, many events are dispatched, one of them allows to
590590react 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+
592618Learn More
593619----------
594620
You can’t perform that action at this time.
0 commit comments