<commit_before>Profiler
========

Features
--------

  - Expose information about the current request
  - Memory Usage / Profiling ...


Configuration
-------------

There is no configuration option. You only need to enable the plugin by adding this line into the IoC configuration file.

.. code-block:: yaml

    element.plugins.profiler:

Usage
-----

The feature is enabled on dev mode, it does not work for threaded environment.

Preview
-------

.. figure:: ../images/profiler_wdt.png
   :align: center

   The wdt displays memory usage, processing time, controller and python version


.. figure:: ../images/profiler_view_config.png
   :align: center

   Display more detailed information profiling panel: config, request, etc ..


Credits
-------

The WDT is a python port of the `Symfony2 Profiler <http://symfony.com>`_.
Icons created by `Sensio <http://sensio.com>`_ are shared under a `Creative Commons Attribution license <http://creativecommons.org/licenses/by-sa/3.0/>`_.
<commit_msg>[profiler] add missing installation instructions<commit_after>Profiler
========

Features
--------

  - Expose information about the current request
  - Memory Usage / Profiling ...


Configuration
-------------

You need to enable the plugin by adding this line into the IoC configuration file.

.. code-block:: yaml

    element.plugins.profiler:

Also, you need to expose the profiler's controllers

.. code-block:: yaml

    # profiler.yaml
    title: Profiler
    type: action.collection
    actions:
        element_profiler_home:
            type: action.raw
            path: /<token>
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:home

        element_profiler_view:
            type: action.raw
            path: /<token>
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:view

        element_profiler_wdt:
            type: action.raw
            path: /wdt/<token>
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:wdt

        element_profiler_pyinfo:
            type: action.raw
            path: /pyinfo
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:pyinfo

        element_profiler_import:
            type: action.raw
            path: /import
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:import_run

        element_profiler_export:
            type: action.raw
            path: /<token>/export
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:export_run

        element_profiler_purge:
            type: action.raw
            path: /<token>/purge
            methods: ['GET']
            defaults:
                _controller: element.plugins.profiler.view:purge_run


Usage
-----

The feature is enabled on dev mode, it does not work for threaded environment.


Preview
-------

.. figure:: ../images/profiler_wdt.png
   :align: center

   The wdt displays memory usage, processing time, controller and python version


.. figure:: ../images/profiler_view_config.png
   :align: center

   Display more detailed information profiling panel: config, request, etc ..


Credits
-------

The WDT is a python port of the `Symfony2 Profiler <http://symfony.com>`_.
Icons created by `Sensio <http://sensio.com>`_ are shared under a `Creative Commons Attribution license <http://creativecommons.org/licenses/by-sa/3.0/>`_.

{'fraction_non_alphanumeric': 0.11046511627906977, 'fraction_numerical': 0.0016611295681063123, 'mean_word_length': 2.141739130434783, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4006304', 'n_tokens_mistral': 1005, 'n_tokens_neox': 973, 'n_words': 296}