<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
    <services>
        <service id="Shopware\Core\Profiling\Integration\Stopwatch">
            <argument type="service" id="debug.stopwatch" on-invalid="null"/>

            <tag name="shopware.profiler" integration="Symfony"/>
        </service>

        <service id="Shopware\Core\Profiling\Integration\Tideways">
            <tag name="shopware.profiler" integration="Tideways"/>
        </service>

        <service id="Shopware\Core\Profiling\Integration\Datadog">
            <tag name="shopware.profiler" integration="Datadog"/>
        </service>

        <service id="Shopware\Core\Profiling\Profiler" public="true">
            <argument type="tagged_iterator" tag="shopware.profiler" index-by="integration"/>
            <argument>%shopware.profiler.integrations%</argument>
        </service>

        <service id="Shopware\Core\Profiling\Doctrine\ConnectionProfiler">
            <argument type="service" id="Doctrine\DBAL\Connection" />
            <tag name="data_collector"
                 template="@Profiling/Collector/db.html.twig"
                 id="app.connection_collector"
                 priority="200"
            />
        </service>

        <service id="Shopware\Core\Profiling\Twig\DoctrineExtension" public="false">
            <tag name="twig.extension" />
        </service>

        <service id="Shopware\Core\Profiling\Subscriber\ActiveRulesDataCollectorSubscriber">
            <argument type="service" id="rule.repository"/>

            <tag name="kernel.event_subscriber"/>
            <tag name="data_collector"/>
        </service>
    </services>
</container>
