summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/sdk/Metrics/UpDownCounter.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/open-telemetry/sdk/Metrics/UpDownCounter.php')
-rw-r--r--vendor/open-telemetry/sdk/Metrics/UpDownCounter.php37
1 files changed, 0 insertions, 37 deletions
diff --git a/vendor/open-telemetry/sdk/Metrics/UpDownCounter.php b/vendor/open-telemetry/sdk/Metrics/UpDownCounter.php
deleted file mode 100644
index 1adf67f8a..000000000
--- a/vendor/open-telemetry/sdk/Metrics/UpDownCounter.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace OpenTelemetry\SDK\Metrics;
-
-use OpenTelemetry\API\Metrics\UpDownCounterInterface;
-use OpenTelemetry\SDK\Metrics\MetricRegistry\MetricWriterInterface;
-
-/**
- * @internal
- */
-final class UpDownCounter implements UpDownCounterInterface
-{
- private MetricWriterInterface $writer;
- private Instrument $instrument;
- private ReferenceCounterInterface $referenceCounter;
-
- public function __construct(MetricWriterInterface $writer, Instrument $instrument, ReferenceCounterInterface $referenceCounter)
- {
- $this->writer = $writer;
- $this->instrument = $instrument;
- $this->referenceCounter = $referenceCounter;
-
- $this->referenceCounter->acquire();
- }
-
- public function __destruct()
- {
- $this->referenceCounter->release();
- }
-
- public function add($amount, iterable $attributes = [], $context = null): void
- {
- $this->writer->record($this->instrument, $amount, $attributes, $context);
- }
-}