summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php')
-rw-r--r--vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php
new file mode 100644
index 000000000..5866a72b7
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php
@@ -0,0 +1,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);
+ }
+}