services:
    oro_api.profiler.logger:
        class: Oro\Component\ChainProcessor\Debug\TraceLogger
        arguments:
            - 'data_api'
            - '@?debug.stopwatch'

    oro_api.profiler.data_collector:
        class: Oro\Component\ChainProcessor\Debug\ActionProcessorDataCollector
        arguments:
            - '@oro_api.profiler.logger'
        tags:
            - { name: data_collector, template: '@OroApi/Collector/api.html.twig', id: data_api }

    oro_api.profiler.processor_registry:
        class: Oro\Component\ChainProcessor\Debug\TraceableProcessorRegistry
        decorates: oro_api.processor_registry
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.processor_applicable_checker_factory:
        class: Oro\Component\ChainProcessor\Debug\TraceableProcessorApplicableCheckerFactory
        decorates: oro_api.processor_applicable_checker_factory
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.collect_resources.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.collect_resources.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.collect_subresources.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.collect_subresources.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.customize_loaded_data.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.customize_loaded_data.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.customize_form_data.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.customize_form_data.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.get_config.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.get_config.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.get_metadata.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.get_metadata.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'

    oro_api.profiler.normalize_value.processor:
        class: Oro\Component\ChainProcessor\Debug\TraceableActionProcessor
        decorates: oro_api.normalize_value.processor
        decoration_priority: -255 # should be at the top of the decoration chain
        arguments:
            - '@.inner'
            - '@oro_api.profiler.logger'
