Skip to content

[Console] Added documentation about command profiling #19265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 </components/console/events>`.

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 </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
----------

Expand Down