summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php
blob: 5866a72b7e22c34f4b2b1e77823f23407fc8b8c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

declare(strict_types=1);

namespace OpenTelemetry\SDK\Metrics\Stream;

use OpenTelemetry\SDK\Metrics\AggregationInterface;
use OpenTelemetry\SDK\Metrics\AttributeProcessorInterface;

/**
 * @internal
 */
final class MetricAggregatorFactory implements MetricAggregatorFactoryInterface
{
    private ?AttributeProcessorInterface $attributeProcessor;
    private AggregationInterface $aggregation;

    public function __construct(?AttributeProcessorInterface $attributeProcessor, AggregationInterface $aggregation)
    {
        $this->attributeProcessor = $attributeProcessor;
        $this->aggregation = $aggregation;
    }

    public function create(): MetricAggregatorInterface
    {
        return new MetricAggregator($this->attributeProcessor, $this->aggregation);
    }
}