From 4945d0a17411f8e697b4a9377db7a2c85d030514 Mon Sep 17 00:00:00 2001 From: Maelan LE BORGNE Date: Tue, 12 Dec 2023 10:14:13 +0100 Subject: [PATCH] [Console] Added documentation about command profiling --- console.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/console.rst b/console.rst index b3c6f735545..1e76a9ab3f7 100644 --- a/console.rst +++ b/console.rst @@ -619,6 +619,36 @@ Using Events And Handling Signals When a command is running, many events are dispatched, one of them allows to react to signals, read more in :doc:`this section `. +Profiling Commands +------------------ + +When debug mode and the profiler are enabled, you can run a command with the +``--profile`` option. Symfony will then collect data about the command execution. +When the execution is over, the profile is accessible through the web page of +the :doc:`Symfony Profiler `. + +.. tip:: + + If you run the command in verbose mode (``-v``), Symfony will display + in the output a clickable link to the command profile (if your terminal + supports links). If you run it in debug verbosity (``-vvv``) you'll + also see the time and memory consumed by the command. + + .. code-block:: terminal + + $ php bin/console --profile -v app:my-command + ... + + [OK] Command successful ! + + See profile f4ef63 # <- this is a clickable link if your terminal supports it + +``` + +.. versionadded:: 6.4 + + The ``--profile`` option was introduced in Symfony 6.4. + Learn More ----------