From 884fd92f1320d17daebb772297da03fb2cfa59b8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 1 Oct 2024 16:00:34 +0300 Subject: drop opentelemetry --- .../ExplicitBucketHistogramAggregation.php | 167 ----------- .../Aggregation/ExplicitBucketHistogramSummary.php | 40 --- .../Metrics/Aggregation/LastValueAggregation.php | 81 ------ .../sdk/Metrics/Aggregation/LastValueSummary.php | 22 -- .../sdk/Metrics/Aggregation/SumAggregation.php | 91 ------ .../sdk/Metrics/Aggregation/SumSummary.php | 20 -- .../sdk/Metrics/AggregationInterface.php | 57 ---- .../AggregationTemporalitySelectorInterface.php | 21 -- .../FilteredAttributeProcessor.php | 33 --- .../IdentityAttributeProcessor.php | 20 -- .../sdk/Metrics/AttributeProcessorInterface.php | 16 -- vendor/open-telemetry/sdk/Metrics/Counter.php | 37 --- .../sdk/Metrics/Data/DataInterface.php | 9 - .../open-telemetry/sdk/Metrics/Data/Exemplar.php | 65 ----- vendor/open-telemetry/sdk/Metrics/Data/Gauge.php | 22 -- .../open-telemetry/sdk/Metrics/Data/Histogram.php | 29 -- .../sdk/Metrics/Data/HistogramDataPoint.php | 76 ----- vendor/open-telemetry/sdk/Metrics/Data/Metric.php | 46 --- .../sdk/Metrics/Data/NumberDataPoint.php | 43 --- vendor/open-telemetry/sdk/Metrics/Data/Sum.php | 34 --- .../sdk/Metrics/Data/Temporality.php | 20 -- .../DefaultAggregationProviderInterface.php | 13 - .../Metrics/DefaultAggregationProviderTrait.php | 28 -- .../sdk/Metrics/Exemplar/BucketEntry.php | 26 -- .../sdk/Metrics/Exemplar/BucketStorage.php | 92 ------ .../Exemplar/ExemplarFilter/AllExemplarFilter.php | 21 -- .../Exemplar/ExemplarFilter/NoneExemplarFilter.php | 21 -- .../WithSampledTraceExemplarFilter.php | 22 -- .../Metrics/Exemplar/ExemplarFilterInterface.php | 20 -- .../Exemplar/ExemplarReservoirInterface.php | 24 -- .../sdk/Metrics/Exemplar/FilteredReservoir.php | 36 --- .../sdk/Metrics/Exemplar/FixedSizeReservoir.php | 38 --- .../Metrics/Exemplar/HistogramBucketReservoir.php | 40 --- .../sdk/Metrics/Exemplar/NoopReservoir.php | 21 -- vendor/open-telemetry/sdk/Metrics/Histogram.php | 37 --- vendor/open-telemetry/sdk/Metrics/Instrument.php | 36 --- .../open-telemetry/sdk/Metrics/InstrumentType.php | 25 -- vendor/open-telemetry/sdk/Metrics/Meter.php | 314 --------------------- .../sdk/Metrics/MeterInstruments.php | 29 -- .../open-telemetry/sdk/Metrics/MeterProvider.php | 130 --------- .../sdk/Metrics/MeterProviderBuilder.php | 62 ---- .../sdk/Metrics/MeterProviderFactory.php | 78 ----- .../sdk/Metrics/MeterProviderInterface.php | 12 - .../MetricExporter/ConsoleMetricExporter.php | 105 ------- .../ConsoleMetricExporterFactory.php | 16 -- .../Metrics/MetricExporter/InMemoryExporter.php | 78 ----- .../MetricExporter/InMemoryExporterFactory.php | 16 -- .../Metrics/MetricExporter/NoopMetricExporter.php | 23 -- .../MetricExporter/NoopMetricExporterFactory.php | 16 -- .../sdk/Metrics/MetricExporter/_register.php | 7 - .../sdk/Metrics/MetricExporterFactoryInterface.php | 10 - .../sdk/Metrics/MetricExporterInterface.php | 17 -- .../sdk/Metrics/MetricFactory/StreamFactory.php | 187 ------------ .../Metrics/MetricFactory/StreamMetricSource.php | 44 --- .../MetricFactory/StreamMetricSourceProvider.php | 98 ------- .../sdk/Metrics/MetricFactoryInterface.php | 41 --- .../sdk/Metrics/MetricMetadataInterface.php | 28 -- .../sdk/Metrics/MetricReader/ExportingReader.php | 156 ---------- .../sdk/Metrics/MetricReaderInterface.php | 14 - .../MultiRegistryRegistration.php | 36 --- .../MetricRegistration/RegistryRegistration.php | 31 -- .../sdk/Metrics/MetricRegistrationInterface.php | 13 - .../MetricRegistry/MetricCollectorInterface.php | 13 - .../sdk/Metrics/MetricRegistry/MetricRegistry.php | 184 ------------ .../MetricRegistry/MetricRegistryInterface.php | 22 -- .../MetricRegistry/MetricWriterInterface.php | 20 -- .../sdk/Metrics/MetricRegistry/MultiObserver.php | 37 --- .../sdk/Metrics/MetricRegistry/NoopObserver.php | 18 -- .../sdk/Metrics/MetricSourceInterface.php | 24 -- .../sdk/Metrics/MetricSourceProviderInterface.php | 15 - .../sdk/Metrics/MetricSourceRegistryInterface.php | 10 - .../sdk/Metrics/NoopMeterProvider.php | 26 -- .../sdk/Metrics/ObservableCallback.php | 58 ---- .../sdk/Metrics/ObservableCallbackDestructor.php | 32 --- .../sdk/Metrics/ObservableCounter.php | 15 - .../open-telemetry/sdk/Metrics/ObservableGauge.php | 15 - .../sdk/Metrics/ObservableInstrumentTrait.php | 61 ---- .../sdk/Metrics/ObservableUpDownCounter.php | 15 - .../sdk/Metrics/PushMetricExporterInterface.php | 12 - .../sdk/Metrics/ReferenceCounterInterface.php | 15 - .../StalenessHandler/DelayedStalenessHandler.php | 71 ----- .../DelayedStalenessHandlerFactory.php | 64 ----- .../StalenessHandler/ImmediateStalenessHandler.php | 50 ---- .../ImmediateStalenessHandlerFactory.php | 16 -- .../StalenessHandler/NoopStalenessHandler.php | 30 -- .../NoopStalenessHandlerFactory.php | 18 -- .../Metrics/StalenessHandlerFactoryInterface.php | 13 - .../sdk/Metrics/StalenessHandlerInterface.php | 12 - .../Metrics/Stream/AsynchronousMetricStream.php | 111 -------- vendor/open-telemetry/sdk/Metrics/Stream/Delta.php | 33 --- .../sdk/Metrics/Stream/DeltaStorage.php | 110 -------- .../open-telemetry/sdk/Metrics/Stream/Metric.php | 44 --- .../sdk/Metrics/Stream/MetricAggregator.php | 73 ----- .../sdk/Metrics/Stream/MetricAggregatorFactory.php | 28 -- .../Stream/MetricAggregatorFactoryInterface.php | 13 - .../Metrics/Stream/MetricAggregatorInterface.php | 12 - .../Metrics/Stream/MetricCollectorInterface.php | 13 - .../sdk/Metrics/Stream/MetricStreamInterface.php | 58 ---- .../sdk/Metrics/Stream/SynchronousMetricStream.php | 126 --------- .../Stream/WritableMetricStreamInterface.php | 19 -- .../open-telemetry/sdk/Metrics/UpDownCounter.php | 37 --- .../sdk/Metrics/View/CriteriaViewRegistry.php | 40 --- .../Metrics/View/SelectionCriteria/AllCriteria.php | 33 --- .../SelectionCriteria/InstrumentNameCriteria.php | 28 -- .../SelectionCriteria/InstrumentTypeCriteria.php | 29 -- .../InstrumentationScopeNameCriteria.php | 24 -- .../InstrumentationScopeSchemaUrlCriteria.php | 24 -- .../InstrumentationScopeVersionCriteria.php | 24 -- .../Metrics/View/SelectionCriteriaInterface.php | 13 - .../sdk/Metrics/View/ViewTemplate.php | 77 ----- .../open-telemetry/sdk/Metrics/ViewProjection.php | 47 --- .../sdk/Metrics/ViewRegistryInterface.php | 15 - 112 files changed, 4907 deletions(-) delete mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/AggregationInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/AttributeProcessor/FilteredAttributeProcessor.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/AttributeProcessorInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Counter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Exemplar.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Gauge.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Histogram.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Metric.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Sum.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Temporality.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/DefaultAggregationProviderInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/DefaultAggregationProviderTrait.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/BucketEntry.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/BucketStorage.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/NoneExemplarFilter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/WithSampledTraceExemplarFilter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarReservoirInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Histogram.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Instrument.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/InstrumentType.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Meter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MeterInstruments.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProvider.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/NoopMetricExporter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/NoopMetricExporterFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/_register.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporterFactoryInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporterInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricReader/ExportingReader.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistration/MultiRegistryRegistration.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricCollectorInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistry.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricWriterInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MultiObserver.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricSourceInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricSourceProviderInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/MetricSourceRegistryInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/NoopMeterProvider.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableCallback.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableCounter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableGauge.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableInstrumentTrait.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/PushMetricExporterInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ReferenceCounterInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandler.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/NoopStalenessHandler.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/NoopStalenessHandlerFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandlerFactoryInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandlerInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/AsynchronousMetricStream.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/Delta.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/Metric.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricCollectorInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/SynchronousMetricStream.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/UpDownCounter.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/View/ViewTemplate.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ViewProjection.php delete mode 100644 vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php (limited to 'vendor/open-telemetry/sdk/Metrics') diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php deleted file mode 100644 index d68ecd830..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php +++ /dev/null @@ -1,167 +0,0 @@ - - */ -final class ExplicitBucketHistogramAggregation implements AggregationInterface -{ - /** - * @var list - * @readonly - */ - public array $boundaries; - - /** - * @param list $boundaries strictly ascending histogram bucket boundaries - */ - public function __construct(array $boundaries) - { - $this->boundaries = $boundaries; - } - - public function initialize(): ExplicitBucketHistogramSummary - { - return new ExplicitBucketHistogramSummary( - 0, - 0, - +INF, - -INF, - array_fill(0, count($this->boundaries) + 1, 0), - ); - } - - /** - * @param ExplicitBucketHistogramSummary $summary - */ - public function record($summary, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - $boundariesCount = count($this->boundaries); - for ($i = 0; $i < $boundariesCount && $this->boundaries[$i] < $value; $i++) { - } - $summary->count++; - $summary->sum += $value; - $summary->min = self::min($value, $summary->min); - $summary->max = self::max($value, $summary->max); - $summary->buckets[$i]++; - } - - /** - * @param ExplicitBucketHistogramSummary $left - * @param ExplicitBucketHistogramSummary $right - */ - public function merge($left, $right): ExplicitBucketHistogramSummary - { - $count = $left->count + $right->count; - $sum = $left->sum + $right->sum; - $min = self::min($left->min, $right->min); - $max = self::max($left->max, $right->max); - $buckets = $right->buckets; - foreach ($left->buckets as $i => $bucketCount) { - $buckets[$i] += $bucketCount; - } - - return new ExplicitBucketHistogramSummary( - $count, - $sum, - $min, - $max, - $buckets, - ); - } - - /** - * @param ExplicitBucketHistogramSummary $left - * @param ExplicitBucketHistogramSummary $right - */ - public function diff($left, $right): ExplicitBucketHistogramSummary - { - $count = -$left->count + $right->count; - $sum = -$left->sum + $right->sum; - $min = $left->min > $right->min ? $right->min : NAN; - $max = $left->max < $right->max ? $right->max : NAN; - $buckets = $right->buckets; - foreach ($left->buckets as $i => $bucketCount) { - $buckets[$i] -= $bucketCount; - } - - return new ExplicitBucketHistogramSummary( - $count, - $sum, - $min, - $max, - $buckets, - ); - } - - /** - * @param array $summaries - */ - public function toData( - array $attributes, - array $summaries, - array $exemplars, - int $startTimestamp, - int $timestamp, - $temporality - ): Data\Histogram { - $dataPoints = []; - foreach ($attributes as $key => $dataPointAttributes) { - if ($summaries[$key]->count === 0) { - continue; - } - - $dataPoints[] = new Data\HistogramDataPoint( - $summaries[$key]->count, - $summaries[$key]->sum, - $summaries[$key]->min, - $summaries[$key]->max, - $summaries[$key]->buckets, - $this->boundaries, - $dataPointAttributes, - $startTimestamp, - $timestamp, - $exemplars[$key] ?? [], - ); - } - - return new Data\Histogram( - $dataPoints, - $temporality, - ); - } - - /** - * @param float|int $left - * @param float|int $right - * @return float|int - */ - private static function min($left, $right) - { - /** @noinspection PhpConditionAlreadyCheckedInspection */ - return $left <= $right ? $left : ($right <= $left ? $right : NAN); - } - - /** - * @param float|int $left - * @param float|int $right - * @return float|int - */ - private static function max($left, $right) - { - /** @noinspection PhpConditionAlreadyCheckedInspection */ - return $left >= $right ? $left : ($right >= $left ? $right : NAN); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php deleted file mode 100644 index 1878a34a0..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php +++ /dev/null @@ -1,40 +0,0 @@ -count = $count; - $this->sum = $sum; - $this->min = $min; - $this->max = $max; - $this->buckets = $buckets; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php deleted file mode 100644 index aff04e315..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ -final class LastValueAggregation implements AggregationInterface -{ - public function initialize(): LastValueSummary - { - return new LastValueSummary(null, 0); - } - - /** - * @param LastValueSummary $summary - */ - public function record($summary, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - if ($summary->value === null || $timestamp >= $summary->timestamp) { - $summary->value = $value; - $summary->timestamp = $timestamp; - } - } - - /** - * @param LastValueSummary $left - * @param LastValueSummary $right - */ - public function merge($left, $right): LastValueSummary - { - return $right->timestamp >= $left->timestamp ? $right : $left; - } - - /** - * @param LastValueSummary $left - * @param LastValueSummary $right - */ - public function diff($left, $right): LastValueSummary - { - return $right->timestamp >= $left->timestamp ? $right : $left; - } - - /** - * @param array $summaries - */ - public function toData( - array $attributes, - array $summaries, - array $exemplars, - int $startTimestamp, - int $timestamp, - $temporality - ): Data\Gauge { - $dataPoints = []; - foreach ($attributes as $key => $dataPointAttributes) { - if ($summaries[$key]->value === null) { - continue; - } - - $dataPoints[] = new Data\NumberDataPoint( - $summaries[$key]->value, - $dataPointAttributes, - $startTimestamp, - $timestamp, - $exemplars[$key] ?? [], - ); - } - - return new Data\Gauge( - $dataPoints, - ); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php deleted file mode 100644 index 6cdb5ac9f..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php +++ /dev/null @@ -1,22 +0,0 @@ -value = $value; - $this->timestamp = $timestamp; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php deleted file mode 100644 index dc317ce73..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php +++ /dev/null @@ -1,91 +0,0 @@ - - */ -final class SumAggregation implements AggregationInterface -{ - private bool $monotonic; - - public function __construct(bool $monotonic = false) - { - $this->monotonic = $monotonic; - } - - public function initialize(): SumSummary - { - return new SumSummary(0); - } - - /** - * @param SumSummary $summary - */ - public function record($summary, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - $summary->value += $value; - } - - /** - * @param SumSummary $left - * @param SumSummary $right - */ - public function merge($left, $right): SumSummary - { - $sum = $left->value + $right->value; - - return new SumSummary( - $sum, - ); - } - - /** - * @param SumSummary $left - * @param SumSummary $right - */ - public function diff($left, $right): SumSummary - { - $sum = -$left->value + $right->value; - - return new SumSummary( - $sum, - ); - } - - /** - * @param array $summaries - */ - public function toData( - array $attributes, - array $summaries, - array $exemplars, - int $startTimestamp, - int $timestamp, - $temporality - ): Data\Sum { - $dataPoints = []; - foreach ($attributes as $key => $dataPointAttributes) { - $dataPoints[] = new Data\NumberDataPoint( - $summaries[$key]->value, - $dataPointAttributes, - $startTimestamp, - $timestamp, - $exemplars[$key] ?? [], - ); - } - - return new Data\Sum( - $dataPoints, - $temporality, - $this->monotonic, - ); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php deleted file mode 100644 index 9b257193c..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php +++ /dev/null @@ -1,20 +0,0 @@ -value = $value; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/AggregationInterface.php b/vendor/open-telemetry/sdk/Metrics/AggregationInterface.php deleted file mode 100644 index 0a85207e0..000000000 --- a/vendor/open-telemetry/sdk/Metrics/AggregationInterface.php +++ /dev/null @@ -1,57 +0,0 @@ - $attributes - * @psalm-param array $summaries - * @param array> $exemplars - * @param string|Temporality $temporality - */ - public function toData( - array $attributes, - array $summaries, - array $exemplars, - int $startTimestamp, - int $timestamp, - $temporality - ): DataInterface; -} diff --git a/vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php b/vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php deleted file mode 100644 index f046d033d..000000000 --- a/vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -attributeKeys = $attributeKeys; - } - - public function process(AttributesInterface $attributes, ContextInterface $context): AttributesInterface - { - $filtered = []; - foreach ($this->attributeKeys as $key) { - $filtered[$key] = $attributes->get($key); - } - - return new Attributes($filtered, 0); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php b/vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php deleted file mode 100644 index f261563ea..000000000 --- a/vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php +++ /dev/null @@ -1,20 +0,0 @@ -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); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php b/vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php deleted file mode 100644 index 7aa0c0e20..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php +++ /dev/null @@ -1,9 +0,0 @@ -index = $index; - $this->value = $value; - $this->timestamp = $timestamp; - $this->attributes = $attributes; - $this->traceId = $traceId; - $this->spanId = $spanId; - } - - /** - * @param iterable $exemplars - * @return array> - */ - public static function groupByIndex(iterable $exemplars): array - { - $grouped = []; - foreach ($exemplars as $exemplar) { - $grouped[$exemplar->index][] = $exemplar; - } - - return $grouped; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Gauge.php b/vendor/open-telemetry/sdk/Metrics/Data/Gauge.php deleted file mode 100644 index 00eb50939..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/Gauge.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @readonly - */ - public iterable $dataPoints; - /** - * @param iterable $dataPoints - */ - public function __construct(iterable $dataPoints) - { - $this->dataPoints = $dataPoints; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Histogram.php b/vendor/open-telemetry/sdk/Metrics/Data/Histogram.php deleted file mode 100644 index 782698026..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/Histogram.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @readonly - */ - public iterable $dataPoints; - /** - * @var string|Temporality - * @readonly - */ - public $temporality; - /** - * @param iterable $dataPoints - * @param string|Temporality $temporality - */ - public function __construct(iterable $dataPoints, $temporality) - { - $this->dataPoints = $dataPoints; - $this->temporality = $temporality; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php b/vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php deleted file mode 100644 index 4c9df07b4..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @readonly - */ - public array $explicitBounds; - /** - * @readonly - */ - public AttributesInterface $attributes; - /** - * @readonly - */ - public int $startTimestamp; - /** - * @readonly - */ - public int $timestamp; - /** - * @readonly - */ - public iterable $exemplars = []; - /** - * @param float|int $sum - * @param float|int $min - * @param float|int $max - * @param int[] $bucketCounts - * @param list $explicitBounds - */ - public function __construct(int $count, $sum, $min, $max, array $bucketCounts, array $explicitBounds, AttributesInterface $attributes, int $startTimestamp, int $timestamp, iterable $exemplars = []) - { - $this->count = $count; - $this->sum = $sum; - $this->min = $min; - $this->max = $max; - $this->bucketCounts = $bucketCounts; - $this->explicitBounds = $explicitBounds; - $this->attributes = $attributes; - $this->startTimestamp = $startTimestamp; - $this->timestamp = $timestamp; - $this->exemplars = $exemplars; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Metric.php b/vendor/open-telemetry/sdk/Metrics/Data/Metric.php deleted file mode 100644 index 41fcb52dd..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/Metric.php +++ /dev/null @@ -1,46 +0,0 @@ -instrumentationScope = $instrumentationScope; - $this->resource = $resource; - $this->name = $name; - $this->description = $description; - $this->unit = $unit; - $this->data = $data; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php b/vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php deleted file mode 100644 index 1d00e783a..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php +++ /dev/null @@ -1,43 +0,0 @@ -value = $value; - $this->attributes = $attributes; - $this->startTimestamp = $startTimestamp; - $this->timestamp = $timestamp; - $this->exemplars = $exemplars; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Sum.php b/vendor/open-telemetry/sdk/Metrics/Data/Sum.php deleted file mode 100644 index 77c4c1021..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/Sum.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @readonly - */ - public iterable $dataPoints; - /** - * @var string|Temporality - * @readonly - */ - public $temporality; - /** - * @readonly - */ - public bool $monotonic; - /** - * @param iterable $dataPoints - * @param string|Temporality $temporality - */ - public function __construct(iterable $dataPoints, $temporality, bool $monotonic) - { - $this->dataPoints = $dataPoints; - $this->temporality = $temporality; - $this->monotonic = $monotonic; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Temporality.php b/vendor/open-telemetry/sdk/Metrics/Data/Temporality.php deleted file mode 100644 index b6642ebd0..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Data/Temporality.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - private array $buckets; - - public function __construct(int $size = 0) - { - $this->buckets = array_fill(0, $size, null); - } - - /** - * @param int|string $index - * @param float|int $value - */ - public function store(int $bucket, $index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - assert($bucket <= count($this->buckets)); - - $exemplar = $this->buckets[$bucket] ??= new BucketEntry(); - $exemplar->index = $index; - $exemplar->value = $value; - $exemplar->timestamp = $timestamp; - $exemplar->attributes = $attributes; - - if (($spanContext = Span::fromContext($context)->getContext())->isValid()) { - $exemplar->traceId = $spanContext->getTraceId(); - $exemplar->spanId = $spanContext->getSpanId(); - } else { - $exemplar->traceId = null; - $exemplar->spanId = null; - } - } - - /** - * @param array $dataPointAttributes - * @return array - */ - public function collect(array $dataPointAttributes): array - { - $exemplars = []; - foreach ($this->buckets as $index => &$exemplar) { - if (!$exemplar) { - continue; - } - - $exemplars[$index] = new Exemplar( - $exemplar->index, - $exemplar->value, - $exemplar->timestamp, - $this->filterExemplarAttributes( - $dataPointAttributes[$exemplar->index], - $exemplar->attributes, - ), - $exemplar->traceId, - $exemplar->spanId, - ); - $exemplar = null; - } - - return $exemplars; - } - - private function filterExemplarAttributes(AttributesInterface $dataPointAttributes, AttributesInterface $exemplarAttributes): AttributesInterface - { - $attributes = []; - foreach ($exemplarAttributes as $key => $value) { - if ($dataPointAttributes->get($key) === null) { - $attributes[$key] = $value; - } - } - - return new Attributes($attributes, $exemplarAttributes->getDroppedAttributesCount()); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php deleted file mode 100644 index b74e738aa..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php +++ /dev/null @@ -1,21 +0,0 @@ -getContext()->isSampled(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php deleted file mode 100644 index 1d5dec7b8..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - $dataPointAttributes - * @return array - */ - public function collect(array $dataPointAttributes): array; -} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php deleted file mode 100644 index 0e4f24357..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php +++ /dev/null @@ -1,36 +0,0 @@ -reservoir = $reservoir; - $this->filter = $filter; - } - - public function offer($index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - if ($this->filter->accepts($value, $attributes, $context, $timestamp)) { - $this->reservoir->offer($index, $value, $attributes, $context, $timestamp); - } - } - - public function collect(array $dataPointAttributes): array - { - return $this->reservoir->collect($dataPointAttributes); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php deleted file mode 100644 index 479292a4c..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php +++ /dev/null @@ -1,38 +0,0 @@ -storage = new BucketStorage($size); - $this->size = $size; - } - - public function offer($index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - $bucket = random_int(0, $this->measurements); - $this->measurements++; - if ($bucket < $this->size) { - $this->storage->store($bucket, $index, $value, $attributes, $context, $timestamp); - } - } - - public function collect(array $dataPointAttributes): array - { - $this->measurements = 0; - - return $this->storage->collect($dataPointAttributes); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php deleted file mode 100644 index b56a1b2be..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ - private array $boundaries; - - /** - * @param list $boundaries - */ - public function __construct(array $boundaries) - { - $this->storage = new BucketStorage(count($boundaries) + 1); - $this->boundaries = $boundaries; - } - - public function offer($index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - $boundariesCount = count($this->boundaries); - for ($i = 0; $i < $boundariesCount && $this->boundaries[$i] < $value; $i++) { - } - $this->storage->store($i, $index, $value, $attributes, $context, $timestamp); - } - - public function collect(array $dataPointAttributes): array - { - return $this->storage->collect($dataPointAttributes); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php deleted file mode 100644 index 010aeff20..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php +++ /dev/null @@ -1,21 +0,0 @@ -writer = $writer; - $this->instrument = $instrument; - $this->referenceCounter = $referenceCounter; - - $this->referenceCounter->acquire(); - } - - public function __destruct() - { - $this->referenceCounter->release(); - } - - public function record($amount, iterable $attributes = [], $context = null): void - { - $this->writer->record($this->instrument, $amount, $attributes, $context); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Instrument.php b/vendor/open-telemetry/sdk/Metrics/Instrument.php deleted file mode 100644 index 3543604c0..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Instrument.php +++ /dev/null @@ -1,36 +0,0 @@ -type = $type; - $this->name = $name; - $this->unit = $unit; - $this->description = $description; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/InstrumentType.php b/vendor/open-telemetry/sdk/Metrics/InstrumentType.php deleted file mode 100644 index ae603b2fe..000000000 --- a/vendor/open-telemetry/sdk/Metrics/InstrumentType.php +++ /dev/null @@ -1,25 +0,0 @@ - */ - private iterable $metricRegistries; - private ViewRegistryInterface $viewRegistry; - private ?ExemplarFilterInterface $exemplarFilter; - private MeterInstruments $instruments; - private InstrumentationScopeInterface $instrumentationScope; - - private MetricRegistryInterface $registry; - private MetricWriterInterface $writer; - - private ?string $instrumentationScopeId = null; - - /** - * @param iterable $metricRegistries - */ - public function __construct( - MetricFactoryInterface $metricFactory, - ResourceInfo $resource, - ClockInterface $clock, - StalenessHandlerFactoryInterface $stalenessHandlerFactory, - iterable $metricRegistries, - ViewRegistryInterface $viewRegistry, - ?ExemplarFilterInterface $exemplarFilter, - MeterInstruments $instruments, - InstrumentationScopeInterface $instrumentationScope, - MetricRegistryInterface $registry, - MetricWriterInterface $writer - ) { - $this->metricFactory = $metricFactory; - $this->resource = $resource; - $this->clock = $clock; - $this->stalenessHandlerFactory = $stalenessHandlerFactory; - $this->metricRegistries = $metricRegistries; - $this->viewRegistry = $viewRegistry; - $this->exemplarFilter = $exemplarFilter; - $this->instruments = $instruments; - $this->instrumentationScope = $instrumentationScope; - $this->registry = $registry; - $this->writer = $writer; - } - - public function createCounter(string $name, ?string $unit = null, ?string $description = null): CounterInterface - { - [$instrument, $referenceCounter] = $this->createSynchronousWriter( - InstrumentType::COUNTER, - $name, - $unit, - $description, - ); - - return new Counter($this->writer, $instrument, $referenceCounter); - } - - public function createObservableCounter(string $name, ?string $unit = null, ?string $description = null, callable ...$callbacks): ObservableCounterInterface - { - [$instrument, $referenceCounter, $destructors] = $this->createAsynchronousObserver( - InstrumentType::ASYNCHRONOUS_COUNTER, - $name, - $unit, - $description, - ); - - foreach ($callbacks as $callback) { - $this->writer->registerCallback(closure($callback), $instrument); - $referenceCounter->acquire(true); - } - - return new ObservableCounter($this->writer, $instrument, $referenceCounter, $destructors); - } - - public function createHistogram(string $name, ?string $unit = null, ?string $description = null): HistogramInterface - { - [$instrument, $referenceCounter] = $this->createSynchronousWriter( - InstrumentType::HISTOGRAM, - $name, - $unit, - $description, - ); - - return new Histogram($this->writer, $instrument, $referenceCounter); - } - - public function createObservableGauge(string $name, ?string $unit = null, ?string $description = null, callable ...$callbacks): ObservableGaugeInterface - { - [$instrument, $referenceCounter, $destructors] = $this->createAsynchronousObserver( - InstrumentType::ASYNCHRONOUS_GAUGE, - $name, - $unit, - $description, - ); - - foreach ($callbacks as $callback) { - $this->writer->registerCallback(closure($callback), $instrument); - $referenceCounter->acquire(true); - } - - return new ObservableGauge($this->writer, $instrument, $referenceCounter, $destructors); - } - - public function createUpDownCounter(string $name, ?string $unit = null, ?string $description = null): UpDownCounterInterface - { - [$instrument, $referenceCounter] = $this->createSynchronousWriter( - InstrumentType::UP_DOWN_COUNTER, - $name, - $unit, - $description, - ); - - return new UpDownCounter($this->writer, $instrument, $referenceCounter); - } - - public function createObservableUpDownCounter(string $name, ?string $unit = null, ?string $description = null, callable ...$callbacks): ObservableUpDownCounterInterface - { - [$instrument, $referenceCounter, $destructors] = $this->createAsynchronousObserver( - InstrumentType::ASYNCHRONOUS_UP_DOWN_COUNTER, - $name, - $unit, - $description, - ); - - foreach ($callbacks as $callback) { - $this->writer->registerCallback(closure($callback), $instrument); - $referenceCounter->acquire(true); - } - - return new ObservableUpDownCounter($this->writer, $instrument, $referenceCounter, $destructors); - } - - /** - * @param string|InstrumentType $instrumentType - * @return array{Instrument, ReferenceCounterInterface} - */ - private function createSynchronousWriter($instrumentType, string $name, ?string $unit, ?string $description): array - { - $instrument = new Instrument($instrumentType, $name, $unit, $description); - - $instrumentationScopeId = $this->instrumentationScopeId($this->instrumentationScope); - $instrumentId = $this->instrumentId($instrument); - - $instruments = $this->instruments; - if ($writer = $instruments->writers[$instrumentationScopeId][$instrumentId] ?? null) { - return $writer; - } - - $stalenessHandler = $this->stalenessHandlerFactory->create(); - $instruments->startTimestamp ??= $this->clock->now(); - $streamIds = $this->metricFactory->createSynchronousWriter( - $this->registry, - $this->resource, - $this->instrumentationScope, - $instrument, - $instruments->startTimestamp, - $this->viewRegistrationRequests($instrument, $stalenessHandler), - $this->exemplarFilter, - ); - - $registry = $this->registry; - $stalenessHandler->onStale(static function () use ($instruments, $instrumentationScopeId, $instrumentId, $registry, $streamIds): void { - unset($instruments->writers[$instrumentationScopeId][$instrumentId]); - if (!$instruments->writers[$instrumentationScopeId]) { - unset($instruments->writers[$instrumentationScopeId]); - } - foreach ($streamIds as $streamId) { - $registry->unregisterStream($streamId); - } - - $instruments->startTimestamp = null; - }); - - return $instruments->writers[$instrumentationScopeId][$instrumentId] = [ - $instrument, - $stalenessHandler, - ]; - } - - /** - * @param string|InstrumentType $instrumentType - * @return array{Instrument, ReferenceCounterInterface, ArrayAccess} - */ - private function createAsynchronousObserver($instrumentType, string $name, ?string $unit, ?string $description): array - { - $instrument = new Instrument($instrumentType, $name, $unit, $description); - - $instrumentationScopeId = $this->instrumentationScopeId($this->instrumentationScope); - $instrumentId = $this->instrumentId($instrument); - - $instruments = $this->instruments; - /** @phan-suppress-next-line PhanDeprecatedProperty */ - $instruments->staleObservers = []; - if ($observer = $instruments->observers[$instrumentationScopeId][$instrumentId] ?? null) { - return $observer; - } - - $stalenessHandler = $this->stalenessHandlerFactory->create(); - $instruments->startTimestamp ??= $this->clock->now(); - $streamIds = $this->metricFactory->createAsynchronousObserver( - $this->registry, - $this->resource, - $this->instrumentationScope, - $instrument, - $instruments->startTimestamp, - $this->viewRegistrationRequests($instrument, $stalenessHandler), - ); - - $registry = $this->registry; - $stalenessHandler->onStale(static function () use ($instruments, $instrumentationScopeId, $instrumentId, $registry, $streamIds): void { - if (PHP_VERSION_ID < 80000) { - /** @phan-suppress-next-line PhanDeprecatedProperty */ - $instruments->staleObservers[] = $instruments->observers[$instrumentationScopeId][$instrumentId][2]; - } - - unset($instruments->observers[$instrumentationScopeId][$instrumentId]); - if (!$instruments->observers[$instrumentationScopeId]) { - unset($instruments->observers[$instrumentationScopeId]); - } - foreach ($streamIds as $streamId) { - $registry->unregisterStream($streamId); - } - - $instruments->startTimestamp = null; - }); - - /** @var ArrayAccess $destructors */ - $destructors = WeakMap::create(); - - return $instruments->observers[$instrumentationScopeId][$instrumentId] = [ - $instrument, - $stalenessHandler, - $destructors, - ]; - } - - /** - * @return iterable - */ - private function viewRegistrationRequests(Instrument $instrument, StalenessHandlerInterface $stalenessHandler): iterable - { - $views = $this->viewRegistry->find($instrument, $this->instrumentationScope) ?? [ - new ViewProjection( - $instrument->name, - $instrument->unit, - $instrument->description, - null, - null, - ), - ]; - - $compositeRegistration = new MultiRegistryRegistration($this->metricRegistries, $stalenessHandler); - foreach ($views as $view) { - if ($view->aggregation !== null) { - yield [$view, $compositeRegistration]; - } else { - foreach ($this->metricRegistries as $metricRegistry) { - yield [ - new ViewProjection( - $view->name, - $view->unit, - $view->description, - $view->attributeKeys, - $metricRegistry->defaultAggregation($instrument->type), - ), - new RegistryRegistration($metricRegistry, $stalenessHandler), - ]; - } - } - } - } - - private function instrumentationScopeId(InstrumentationScopeInterface $instrumentationScope): string - { - return $this->instrumentationScopeId ??= serialize($instrumentationScope); - } - - private function instrumentId(Instrument $instrument): string - { - return serialize($instrument); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterInstruments.php b/vendor/open-telemetry/sdk/Metrics/MeterInstruments.php deleted file mode 100644 index c331cb608..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MeterInstruments.php +++ /dev/null @@ -1,29 +0,0 @@ -}>> - */ - public array $observers = []; - /** - * @var array> - */ - public array $writers = []; - - /** - * @var list> - * @deprecated - */ - public array $staleObservers = []; -} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProvider.php b/vendor/open-telemetry/sdk/Metrics/MeterProvider.php deleted file mode 100644 index 36c17cf81..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MeterProvider.php +++ /dev/null @@ -1,130 +0,0 @@ - $metricReaders - */ - public function __construct( - ?ContextStorageInterface $contextStorage, - ResourceInfo $resource, - ClockInterface $clock, - AttributesFactoryInterface $attributesFactory, - InstrumentationScopeFactoryInterface $instrumentationScopeFactory, - iterable $metricReaders, - ViewRegistryInterface $viewRegistry, - ?ExemplarFilterInterface $exemplarFilter, - StalenessHandlerFactoryInterface $stalenessHandlerFactory, - MetricFactoryInterface $metricFactory = null - ) { - $this->metricFactory = $metricFactory ?? new StreamFactory(); - $this->resource = $resource; - $this->clock = $clock; - $this->instrumentationScopeFactory = $instrumentationScopeFactory; - $this->metricReaders = $metricReaders; - $this->viewRegistry = $viewRegistry; - $this->exemplarFilter = $exemplarFilter; - $this->stalenessHandlerFactory = $stalenessHandlerFactory; - $this->instruments = new MeterInstruments(); - - $registry = new MetricRegistry($contextStorage, $attributesFactory, $clock); - $this->registry = $registry; - $this->writer = $registry; - } - - public function getMeter( - string $name, - ?string $version = null, - ?string $schemaUrl = null, - iterable $attributes = [] - ): MeterInterface { - if ($this->closed || Sdk::isDisabled()) { //@todo create meter provider from factory, and move Sdk::isDisabled() there - return new NoopMeter(); - } - - return new Meter( - $this->metricFactory, - $this->resource, - $this->clock, - $this->stalenessHandlerFactory, - $this->metricReaders, - $this->viewRegistry, - $this->exemplarFilter, - $this->instruments, - $this->instrumentationScopeFactory->create($name, $version, $schemaUrl, $attributes), - $this->registry, - $this->writer, - ); - } - - public function shutdown(): bool - { - if ($this->closed) { - return false; - } - - $this->closed = true; - - $success = true; - foreach ($this->metricReaders as $metricReader) { - if (!$metricReader->shutdown()) { - $success = false; - } - } - - return $success; - } - - public function forceFlush(): bool - { - if ($this->closed) { - return false; - } - - $success = true; - foreach ($this->metricReaders as $metricReader) { - if (!$metricReader->forceFlush()) { - $success = false; - } - } - - return $success; - } - - public static function builder(): MeterProviderBuilder - { - return new MeterProviderBuilder(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php b/vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php deleted file mode 100644 index 17f0be895..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php +++ /dev/null @@ -1,62 +0,0 @@ - - private array $metricReaders = []; - private ?ResourceInfo $resource = null; - private ?ExemplarFilterInterface $exemplarFilter = null; - - public function setResource(ResourceInfo $resource): self - { - $this->resource = $resource; - - return $this; - } - - public function setExemplarFilter(ExemplarFilterInterface $exemplarFilter): self - { - $this->exemplarFilter = $exemplarFilter; - - return $this; - } - - public function addReader(MetricReaderInterface $reader): self - { - $this->metricReaders[] = $reader; - - return $this; - } - - /** - * @psalm-suppress PossiblyInvalidArgument - */ - public function build(): MeterProviderInterface - { - return new MeterProvider( - null, - $this->resource ?? ResourceInfoFactory::emptyResource(), - ClockFactory::getDefault(), - Attributes::factory(), - new InstrumentationScopeFactory(Attributes::factory()), - $this->metricReaders, - new CriteriaViewRegistry(), - $this->exemplarFilter ?? new WithSampledTraceExemplarFilter(), - new NoopStalenessHandlerFactory(), - ); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php b/vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php deleted file mode 100644 index 5f7f9988d..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php +++ /dev/null @@ -1,78 +0,0 @@ -create(); - } catch (\Throwable $t) { - self::logWarning(sprintf('Unable to create %s meter provider: %s', $exporterName, $t->getMessage())); - $exporter = new NoopMetricExporter(); - } - - // @todo "The exporter MUST be paired with a periodic exporting MetricReader" - $reader = new ExportingReader($exporter); - $resource = ResourceInfoFactory::defaultResource(); - $exemplarFilter = $this->createExemplarFilter(Configuration::getEnum(Variables::OTEL_METRICS_EXEMPLAR_FILTER)); - - return MeterProvider::builder() - ->setResource($resource) - ->addReader($reader) - ->setExemplarFilter($exemplarFilter) - ->build(); - } - - private function createExemplarFilter(string $name): ExemplarFilterInterface - { - switch ($name) { - case KnownValues::VALUE_WITH_SAMPLED_TRACE: - return new WithSampledTraceExemplarFilter(); - case KnownValues::VALUE_ALL: - return new AllExemplarFilter(); - case KnownValues::VALUE_NONE: - return new NoneExemplarFilter(); - default: - self::logWarning('Unknown exemplar filter: ' . $name); - - return new NoneExemplarFilter(); - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php b/vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php deleted file mode 100644 index fcb951106..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -temporality = $temporality; - } - /** - * @inheritDoc - */ - public function temporality(MetricMetadataInterface $metric) - { - return $this->temporality ?? $metric->temporality(); - } - - /** - * @inheritDoc - */ - public function export(iterable $batch): bool - { - $resource = null; - $scope = null; - foreach ($batch as $metric) { - /** @var Metric $metric */ - if (!$resource) { - $resource = $this->convertResource($metric->resource); - } - if (!$scope) { - $scope = $this->convertInstrumentationScope($metric->instrumentationScope); - $scope['metrics'] = []; - } - $scope['metrics'][] = $this->convertMetric($metric); - } - $output = [ - 'resource' => $resource, - 'scope' => $scope, - ]; - echo json_encode($output, JSON_PRETTY_PRINT) . PHP_EOL; - - return true; - } - - public function shutdown(): bool - { - return true; - } - - public function forceFlush(): bool - { - return true; - } - - private function convertMetric(Metric $metric): array - { - return [ - 'name' => $metric->name, - 'description' => $metric->description, - 'unit' => $metric->unit, - 'data' => $metric->data, - ]; - } - - private function convertResource(ResourceInfo $resource): array - { - return [ - 'attributes' => $resource->getAttributes()->toArray(), - 'dropped_attributes_count' => $resource->getAttributes()->getDroppedAttributesCount(), - ]; - } - private function convertInstrumentationScope(InstrumentationScopeInterface $scope): array - { - return [ - 'name' => $scope->getName(), - 'version' => $scope->getVersion(), - 'attributes' => $scope->getAttributes()->toArray(), - 'dropped_attributes_count' => $scope->getAttributes()->getDroppedAttributesCount(), - 'schema_url' => $scope->getSchemaUrl(), - ]; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php b/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php deleted file mode 100644 index 19088738d..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ - private array $metrics = []; - /** - * @var string|Temporality|null - */ - private $temporality; - - private bool $closed = false; - - /** - * @param string|Temporality|null $temporality - */ - public function __construct($temporality = null) - { - $this->temporality = $temporality; - } - - public function temporality(MetricMetadataInterface $metric) - { - return $this->temporality ?? $metric->temporality(); - } - - /** - * @return list - */ - public function collect(bool $reset = false): array - { - $metrics = $this->metrics; - if ($reset) { - $this->metrics = []; - } - - return $metrics; - } - - public function export(iterable $batch): bool - { - if ($this->closed) { - return false; - } - - /** @psalm-suppress InvalidPropertyAssignmentValue */ - array_push($this->metrics, ...$batch); - - return true; - } - - public function shutdown(): bool - { - if ($this->closed) { - return false; - } - - $this->closed = true; - - return true; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php b/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php deleted file mode 100644 index c72c7b169..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php +++ /dev/null @@ -1,16 +0,0 @@ - $batch - */ - public function export(iterable $batch): bool; - - public function shutdown(): bool; -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php deleted file mode 100644 index 2c3af4c06..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php +++ /dev/null @@ -1,187 +0,0 @@ -aggregation === null) { - continue; - } - - $dedupId = $this->streamId($view->aggregation, $view->attributeKeys); - if (($streamId = $dedup[$dedupId] ?? null) === null) { - $stream = new AsynchronousMetricStream($view->aggregation, $timestamp); - $streamId = $registry->registerAsynchronousStream($instrument, $stream, new MetricAggregatorFactory( - $this->attributeProcessor($view->attributeKeys), - $view->aggregation, - )); - - $streams[$streamId] = $stream; - $dedup[$dedupId] = $streamId; - } - - $this->registerSource( - $view, - $instrument, - $instrumentationScope, - $resource, - $streams[$streamId], - $registry, - $registration, - $streamId, - ); - } - - return array_keys($streams); - } - - public function createSynchronousWriter( - MetricRegistryInterface $registry, - ResourceInfo $resource, - InstrumentationScopeInterface $instrumentationScope, - Instrument $instrument, - int $timestamp, - iterable $views, - ?ExemplarFilterInterface $exemplarFilter = null - ): array { - $streams = []; - $dedup = []; - foreach ($views as [$view, $registration]) { - if ($view->aggregation === null) { - continue; - } - - $dedupId = $this->streamId($view->aggregation, $view->attributeKeys); - if (($streamId = $dedup[$dedupId] ?? null) === null) { - $stream = new SynchronousMetricStream($view->aggregation, $timestamp); - $streamId = $registry->registerSynchronousStream($instrument, $stream, new MetricAggregator( - $this->attributeProcessor($view->attributeKeys), - $view->aggregation, - $this->createExemplarReservoir($view->aggregation, $exemplarFilter), - )); - - $streams[$streamId] = $stream; - $dedup[$dedupId] = $streamId; - } - - $this->registerSource( - $view, - $instrument, - $instrumentationScope, - $resource, - $streams[$streamId], - $registry, - $registration, - $streamId, - ); - } - - return array_keys($streams); - } - - private function attributeProcessor( - ?array $attributeKeys - ): ?AttributeProcessorInterface { - return $attributeKeys !== null - ? new FilteredAttributeProcessor($attributeKeys) - : null; - } - - private function createExemplarReservoir( - AggregationInterface $aggregation, - ?ExemplarFilterInterface $exemplarFilter - ): ?ExemplarReservoirInterface { - if (!$exemplarFilter) { - return null; - } - - if ($aggregation instanceof ExplicitBucketHistogramAggregation && $aggregation->boundaries) { - $exemplarReservoir = new HistogramBucketReservoir($aggregation->boundaries); - } else { - $exemplarReservoir = new FixedSizeReservoir(); - } - - return new FilteredReservoir($exemplarReservoir, $exemplarFilter); - } - - private function registerSource( - ViewProjection $view, - Instrument $instrument, - InstrumentationScopeInterface $instrumentationScope, - ResourceInfo $resource, - MetricStreamInterface $stream, - MetricCollectorInterface $metricCollector, - MetricRegistrationInterface $metricRegistration, - int $streamId - ): void { - $provider = new StreamMetricSourceProvider( - $view, - $instrument, - $instrumentationScope, - $resource, - $stream, - $metricCollector, - $streamId, - ); - - $metricRegistration->register($provider, $provider); - } - - private function streamId(AggregationInterface $aggregation, ?array $attributeKeys): string - { - return $this->trySerialize($aggregation) . serialize($attributeKeys); - } - - private function trySerialize(object $object) - { - try { - return serialize($object); - } catch (Throwable $e) { - } - - return spl_object_id($object); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php deleted file mode 100644 index 4939a5341..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php +++ /dev/null @@ -1,44 +0,0 @@ -provider = $provider; - $this->reader = $reader; - } - - public function collectionTimestamp(): int - { - return $this->provider->stream->timestamp(); - } - - public function collect(): Metric - { - return new Metric( - $this->provider->instrumentationLibrary, - $this->provider->resource, - $this->provider->view->name, - $this->provider->view->unit, - $this->provider->view->description, - $this->provider->stream->collect($this->reader), - ); - } - - public function __destruct() - { - $this->provider->stream->unregister($this->reader); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php deleted file mode 100644 index 657c3ce62..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php +++ /dev/null @@ -1,98 +0,0 @@ -view = $view; - $this->instrument = $instrument; - $this->instrumentationLibrary = $instrumentationLibrary; - $this->resource = $resource; - $this->stream = $stream; - $this->metricCollector = $metricCollector; - $this->streamId = $streamId; - } - - public function create($temporality): MetricSourceInterface - { - return new StreamMetricSource($this, $this->stream->register($temporality)); - } - - public function instrumentType() - { - return $this->instrument->type; - } - - public function name(): string - { - return $this->view->name; - } - - public function unit(): ?string - { - return $this->view->unit; - } - - public function description(): ?string - { - return $this->view->description; - } - - public function temporality() - { - return $this->stream->temporality(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php deleted file mode 100644 index a1e228eef..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - $views - */ - public function createAsynchronousObserver( - MetricRegistryInterface $registry, - ResourceInfo $resource, - InstrumentationScopeInterface $instrumentationScope, - Instrument $instrument, - int $timestamp, - iterable $views - ): array; - - /** - * @param iterable $views - */ - public function createSynchronousWriter( - MetricRegistryInterface $registry, - ResourceInfo $resource, - InstrumentationScopeInterface $instrumentationScope, - Instrument $instrument, - int $timestamp, - iterable $views, - ?ExemplarFilterInterface $exemplarFilter = null - ): array; -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php deleted file mode 100644 index aa1a02d60..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - */ - private array $sources = []; - - /** @var array */ - private array $registries = []; - /** @var array> */ - private array $streamIds = []; - - private bool $closed = false; - - public function __construct(MetricExporterInterface $exporter) - { - $this->exporter = $exporter; - } - - public function defaultAggregation($instrumentType): ?AggregationInterface - { - if ($this->exporter instanceof DefaultAggregationProviderInterface) { - return $this->exporter->defaultAggregation($instrumentType); - } - - return $this->_defaultAggregation($instrumentType); - } - - public function add(MetricSourceProviderInterface $provider, MetricMetadataInterface $metadata, StalenessHandlerInterface $stalenessHandler): void - { - if ($this->closed) { - return; - } - if (!$this->exporter instanceof AggregationTemporalitySelectorInterface) { - return; - } - if (!$temporality = $this->exporter->temporality($metadata)) { - return; - } - - $source = $provider->create($temporality); - $sourceId = spl_object_id($source); - - $this->sources[$sourceId] = $source; - $stalenessHandler->onStale(function () use ($sourceId): void { - unset($this->sources[$sourceId]); - }); - - if (!$provider instanceof StreamMetricSourceProvider) { - return; - } - - $streamId = $provider->streamId; - $registry = $provider->metricCollector; - $registryId = spl_object_id($registry); - - $this->registries[$registryId] = $registry; - $this->streamIds[$registryId][$streamId] ??= 0; - $this->streamIds[$registryId][$streamId]++; - - $stalenessHandler->onStale(function () use ($streamId, $registryId): void { - if (!--$this->streamIds[$registryId][$streamId]) { - unset($this->streamIds[$registryId][$streamId]); - if (!$this->streamIds[$registryId]) { - unset( - $this->registries[$registryId], - $this->streamIds[$registryId], - ); - } - } - }); - } - - private function doCollect(): bool - { - foreach ($this->registries as $registryId => $registry) { - $streamIds = $this->streamIds[$registryId] ?? []; - $registry->collectAndPush(array_keys($streamIds)); - } - - $metrics = []; - foreach ($this->sources as $source) { - $metrics[] = $source->collect(); - } - - if ($metrics === []) { - return true; - } - - return $this->exporter->export($metrics); - } - - public function collect(): bool - { - if ($this->closed) { - return false; - } - - return $this->doCollect(); - } - - public function shutdown(): bool - { - if ($this->closed) { - return false; - } - - $this->closed = true; - - $collect = $this->doCollect(); - $shutdown = $this->exporter->shutdown(); - - $this->sources = []; - - return $collect && $shutdown; - } - - public function forceFlush(): bool - { - if ($this->closed) { - return false; - } - if ($this->exporter instanceof PushMetricExporterInterface) { - $collect = $this->doCollect(); - $forceFlush = $this->exporter->forceFlush(); - - return $collect && $forceFlush; - } - - return true; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php deleted file mode 100644 index f5900eef5..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php +++ /dev/null @@ -1,14 +0,0 @@ - $registries - */ - public function __construct(iterable $registries, StalenessHandlerInterface $stalenessHandler) - { - $this->registries = $registries; - $this->stalenessHandler = $stalenessHandler; - } - - public function register(MetricSourceProviderInterface $provider, MetricMetadataInterface $metadata): void - { - foreach ($this->registries as $registry) { - $registry->add($provider, $metadata, $this->stalenessHandler); - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php deleted file mode 100644 index 3c1108902..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php +++ /dev/null @@ -1,31 +0,0 @@ -registry = $registry; - $this->stalenessHandler = $stalenessHandler; - } - - public function register(MetricSourceProviderInterface $provider, MetricMetadataInterface $metadata): void - { - $this->registry->add($provider, $metadata, $this->stalenessHandler); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php deleted file mode 100644 index b0cc2484e..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php +++ /dev/null @@ -1,13 +0,0 @@ - */ - private array $streams = []; - /** @var array */ - private array $synchronousAggregators = []; - /** @var array */ - private array $asynchronousAggregatorFactories = []; - - /** @var array> */ - private array $instrumentToStreams = []; - /** @var array */ - private array $streamToInstrument = []; - /** @var array> */ - private array $instrumentToCallbacks = []; - /** @var array */ - private array $asynchronousCallbacks = []; - /** @var array> */ - private array $asynchronousCallbackArguments = []; - - public function __construct( - ?ContextStorageInterface $contextStorage, - AttributesFactoryInterface $attributesFactory, - ClockInterface $clock - ) { - $this->contextStorage = $contextStorage; - $this->attributesFactory = $attributesFactory; - $this->clock = $clock; - } - - public function registerSynchronousStream(Instrument $instrument, MetricStreamInterface $stream, MetricAggregatorInterface $aggregator): int - { - $this->streams[] = $stream; - $streamId = array_key_last($this->streams); - $instrumentId = spl_object_id($instrument); - - $this->synchronousAggregators[$streamId] = $aggregator; - $this->instrumentToStreams[$instrumentId][$streamId] = $streamId; - $this->streamToInstrument[$streamId] = $instrumentId; - - return $streamId; - } - - public function registerAsynchronousStream(Instrument $instrument, MetricStreamInterface $stream, MetricAggregatorFactoryInterface $aggregatorFactory): int - { - $this->streams[] = $stream; - $streamId = array_key_last($this->streams); - $instrumentId = spl_object_id($instrument); - - $this->asynchronousAggregatorFactories[$streamId] = $aggregatorFactory; - $this->instrumentToStreams[$instrumentId][$streamId] = $streamId; - $this->streamToInstrument[$streamId] = $instrumentId; - - return $streamId; - } - - public function unregisterStream(int $streamId): void - { - $instrumentId = $this->streamToInstrument[$streamId]; - unset( - $this->streams[$streamId], - $this->synchronousAggregators[$streamId], - $this->asynchronousAggregatorFactories[$streamId], - $this->instrumentToStreams[$instrumentId][$streamId], - $this->streamToInstrument[$streamId], - ); - if (!$this->instrumentToStreams[$instrumentId]) { - unset($this->instrumentToStreams[$instrumentId]); - } - } - - public function record(Instrument $instrument, $value, iterable $attributes = [], $context = null): void - { - $context = Context::resolve($context, $this->contextStorage); - $attributes = $this->attributesFactory->builder($attributes)->build(); - $timestamp = $this->clock->now(); - $instrumentId = spl_object_id($instrument); - foreach ($this->instrumentToStreams[$instrumentId] ?? [] as $streamId) { - if ($aggregator = $this->synchronousAggregators[$streamId] ?? null) { - $aggregator->record($value, $attributes, $context, $timestamp); - } - } - } - - public function registerCallback(Closure $callback, Instrument $instrument, Instrument ...$instruments): int - { - $callbackId = array_key_last($this->asynchronousCallbacks) + 1; - $this->asynchronousCallbacks[$callbackId] = $callback; - - $instrumentId = spl_object_id($instrument); - $this->asynchronousCallbackArguments[$callbackId] = [$instrumentId]; - $this->instrumentToCallbacks[$instrumentId][$callbackId] = $callbackId; - foreach ($instruments as $instrument) { - $instrumentId = spl_object_id($instrument); - $this->asynchronousCallbackArguments[$callbackId][] = $instrumentId; - $this->instrumentToCallbacks[$instrumentId][$callbackId] = $callbackId; - } - - return $callbackId; - } - - public function unregisterCallback(int $callbackId): void - { - $instrumentIds = $this->asynchronousCallbackArguments[$callbackId]; - unset( - $this->asynchronousCallbacks[$callbackId], - $this->asynchronousCallbackArguments[$callbackId], - ); - foreach ($instrumentIds as $instrumentId) { - unset($this->instrumentToCallbacks[$instrumentId][$callbackId]); - if (!$this->instrumentToCallbacks[$instrumentId]) { - unset($this->instrumentToCallbacks[$instrumentId]); - } - } - } - - public function collectAndPush(iterable $streamIds): void - { - $timestamp = $this->clock->now(); - $aggregators = []; - $observers = []; - $callbackIds = []; - foreach ($streamIds as $streamId) { - if (!$aggregator = $this->synchronousAggregators[$streamId] ?? null) { - $aggregator = $this->asynchronousAggregatorFactories[$streamId]->create(); - - $instrumentId = $this->streamToInstrument[$streamId]; - $observers[$instrumentId] ??= new MultiObserver($this->attributesFactory, $timestamp); - $observers[$instrumentId]->writers[] = $aggregator; - foreach ($this->instrumentToCallbacks[$instrumentId] ?? [] as $callbackId) { - $callbackIds[$callbackId] = $callbackId; - } - } - - $aggregators[$streamId] = $aggregator; - } - - $noopObserver = new NoopObserver(); - $callbacks = []; - foreach ($callbackIds as $callbackId) { - $args = []; - foreach ($this->asynchronousCallbackArguments[$callbackId] as $instrumentId) { - $args[] = $observers[$instrumentId] ?? $noopObserver; - } - $callback = $this->asynchronousCallbacks[$callbackId]; - $callbacks[] = static fn () => $callback(...$args); - } - foreach ($callbacks as $callback) { - $callback(); - } - - $timestamp = $this->clock->now(); - foreach ($aggregators as $streamId => $aggregator) { - if ($stream = $this->streams[$streamId] ?? null) { - $stream->push($aggregator->collect($timestamp)); - } - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php deleted file mode 100644 index e86731138..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - */ - public array $writers = []; - - public function __construct(AttributesFactoryInterface $attributesFactory, int $timestamp) - { - $this->attributesFactory = $attributesFactory; - $this->timestamp = $timestamp; - } - - public function observe($amount, iterable $attributes = []): void - { - $context = Context::getRoot(); - $attributes = $this->attributesFactory->builder($attributes)->build(); - foreach ($this->writers as $writer) { - $writer->record($amount, $attributes, $context, $this->timestamp); - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php deleted file mode 100644 index efbd94dac..000000000 --- a/vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php +++ /dev/null @@ -1,18 +0,0 @@ -writer = $writer; - $this->referenceCounter = $referenceCounter; - $this->callbackId = $callbackId; - $this->callbackDestructor = $callbackDestructor; - $this->target = $target; - } - - public function detach(): void - { - if ($this->callbackId === null) { - return; - } - - $this->writer->unregisterCallback($this->callbackId); - $this->referenceCounter->release(); - if ($this->callbackDestructor !== null) { - unset($this->callbackDestructor->callbackIds[$this->callbackId]); - } - - $this->callbackId = null; - } - - public function __destruct() - { - if ($this->callbackDestructor !== null) { - return; - } - if ($this->callbackId === null) { - return; - } - - $this->referenceCounter->acquire(true); - $this->referenceCounter->release(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php b/vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php deleted file mode 100644 index 0dfea3907..000000000 --- a/vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php +++ /dev/null @@ -1,32 +0,0 @@ - */ - public array $callbackIds = []; - private MetricWriterInterface $writer; - private ReferenceCounterInterface $referenceCounter; - - public function __construct(MetricWriterInterface $writer, ReferenceCounterInterface $referenceCounter) - { - $this->writer = $writer; - $this->referenceCounter = $referenceCounter; - } - - public function __destruct() - { - foreach ($this->callbackIds as $callbackId) { - $this->writer->unregisterCallback($callbackId); - $this->referenceCounter->release(); - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/ObservableCounter.php b/vendor/open-telemetry/sdk/Metrics/ObservableCounter.php deleted file mode 100644 index 99ae43eee..000000000 --- a/vendor/open-telemetry/sdk/Metrics/ObservableCounter.php +++ /dev/null @@ -1,15 +0,0 @@ -writer = $writer; - $this->instrument = $instrument; - $this->referenceCounter = $referenceCounter; - $this->destructors = $destructors; - - $this->referenceCounter->acquire(); - } - - public function __destruct() - { - $this->referenceCounter->release(); - } - - /** - * @param callable(ObserverInterface): void $callback - */ - public function observe(callable $callback): ObservableCallbackInterface - { - $callback = weaken(closure($callback), $target); - - $callbackId = $this->writer->registerCallback($callback, $this->instrument); - $this->referenceCounter->acquire(); - - $destructor = null; - if ($target) { - $destructor = $this->destructors[$target] ??= new ObservableCallbackDestructor($this->writer, $this->referenceCounter); - $destructor->callbackIds[$callbackId] = $callbackId; - } - - return new ObservableCallback($this->writer, $this->referenceCounter, $callbackId, $destructor, $target); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php b/vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php deleted file mode 100644 index 8d21be734..000000000 --- a/vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php +++ /dev/null @@ -1,15 +0,0 @@ -stale = $stale; - $this->freshen = $freshen; - } - - public function acquire(bool $persistent = false): void - { - if ($this->count === 0) { - ($this->freshen)($this); - } - - $this->count++; - - if ($persistent) { - $this->onStale = null; - } - } - - public function release(): void - { - if (--$this->count || $this->onStale === null) { - return; - } - - ($this->stale)($this); - } - - public function onStale(Closure $callback): void - { - if ($this->onStale === null) { - return; - } - - $this->onStale[] = $callback; - } - - public function triggerStale(): void - { - assert($this->onStale !== null); - - $callbacks = $this->onStale; - $this->onStale = []; - foreach ($callbacks as $callback) { - $callback(); - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php deleted file mode 100644 index 0d719c74f..000000000 --- a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php +++ /dev/null @@ -1,64 +0,0 @@ -&Traversable */ - private $staleHandlers; - - /** - * @param float $delay delay in seconds - */ - public function __construct(ClockInterface $clock, float $delay) - { - $this->clock = $clock; - $this->nanoDelay = (int) ($delay * 1e9); - - $this->stale = function (DelayedStalenessHandler $handler): void { - $this->staleHandlers[$handler] = $this->clock->now(); - }; - $this->freshen = function (DelayedStalenessHandler $handler): void { - unset($this->staleHandlers[$handler]); - }; - - $this->staleHandlers = WeakMap::create(); - } - - public function create(): StalenessHandlerInterface - { - $this->triggerStaleHandlers(); - - return new DelayedStalenessHandler($this->stale, $this->freshen); - } - - private function triggerStaleHandlers(): void - { - $expired = $this->clock->now() - $this->nanoDelay; - foreach ($this->staleHandlers as $handler => $timestamp) { - if ($timestamp > $expired) { - break; - } - - /** @var DelayedStalenessHandler $handler */ - unset($this->staleHandlers[$handler]); - $handler->triggerStale(); - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php deleted file mode 100644 index a5b32d5c4..000000000 --- a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php +++ /dev/null @@ -1,50 +0,0 @@ -count++; - - if ($persistent) { - $this->onStale = null; - } - } - - public function release(): void - { - if (--$this->count !== 0 || !$this->onStale) { - return; - } - - $callbacks = $this->onStale; - $this->onStale = []; - foreach ($callbacks as $callback) { - $callback(); - } - } - - public function onStale(Closure $callback): void - { - if ($this->onStale === null) { - return; - } - - $this->onStale[] = $callback; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php deleted file mode 100644 index 899615dea..000000000 --- a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php +++ /dev/null @@ -1,16 +0,0 @@ - */ - private array $lastReads = []; - - public function __construct(AggregationInterface $aggregation, int $startTimestamp) - { - $this->aggregation = $aggregation; - $this->startTimestamp = $startTimestamp; - $this->metric = new Metric([], [], $startTimestamp); - } - - public function temporality() - { - return Temporality::CUMULATIVE; - } - - public function timestamp(): int - { - return $this->metric->timestamp; - } - - public function push(Metric $metric): void - { - $this->metric = $metric; - } - - public function register($temporality): int - { - if ($temporality === Temporality::CUMULATIVE) { - return -1; - } - - if (($reader = array_search(null, $this->lastReads, true)) === false) { - $reader = count($this->lastReads); - } - - $this->lastReads[$reader] = $this->metric; - - return $reader; - } - - public function unregister(int $reader): void - { - if (!isset($this->lastReads[$reader])) { - return; - } - - $this->lastReads[$reader] = null; - } - - public function collect(int $reader): DataInterface - { - $metric = $this->metric; - - if (($lastRead = $this->lastReads[$reader] ?? null) === null) { - $temporality = Temporality::CUMULATIVE; - $startTimestamp = $this->startTimestamp; - } else { - $temporality = Temporality::DELTA; - $startTimestamp = $lastRead->timestamp; - - $this->lastReads[$reader] = $metric; - $metric = $this->diff($lastRead, $metric); - } - - return $this->aggregation->toData( - $metric->attributes, - $metric->summaries, - Exemplar::groupByIndex($metric->exemplars), - $startTimestamp, - $metric->timestamp, - $temporality, - ); - } - - private function diff(Metric $lastRead, Metric $metric): Metric - { - $diff = clone $metric; - foreach ($metric->summaries as $k => $summary) { - if (!isset($lastRead->summaries[$k])) { - continue; - } - - $diff->summaries[$k] = $this->aggregation->diff($lastRead->summaries[$k], $summary); - } - - return $diff; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/Delta.php b/vendor/open-telemetry/sdk/Metrics/Stream/Delta.php deleted file mode 100644 index a4ff56d71..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/Delta.php +++ /dev/null @@ -1,33 +0,0 @@ -metric = $metric; - $this->readers = $readers; - $this->prev = $prev; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php b/vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php deleted file mode 100644 index b46a28d65..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php +++ /dev/null @@ -1,110 +0,0 @@ -aggregation = $aggregation; - $this->head = new Delta(new Metric([], [], 0), 0); - - /** @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty */ - unset($this->head->metric); - } - - /** - * @psalm-suppress UndefinedDocblockClass - * @phan-suppress PhanUndeclaredTypeParameter - * @param int|GMP $readers - */ - public function add(Metric $metric, $readers): void - { - /** @phpstan-ignore-next-line */ - if ($readers == 0) { - return; - } - - if (($this->head->prev->readers ?? null) != $readers) { - $this->head->prev = new Delta($metric, $readers, $this->head->prev); - } else { - assert($this->head->prev !== null); - $this->mergeInto($this->head->prev->metric, $metric); - } - } - - public function collect(int $reader, bool $retain = false): ?Metric - { - $n = null; - for ($d = $this->head; $d->prev; $d = $d->prev) { - if (($d->prev->readers >> $reader & 1) != 0) { - if ($n !== null) { - assert($n->prev !== null); - $n->prev->readers ^= $d->prev->readers; - $this->mergeInto($d->prev->metric, $n->prev->metric); - $this->tryUnlink($n); - - if ($n->prev === $d->prev) { - continue; - } - } - - $n = $d; - } - } - - $metric = $n->prev->metric ?? null; - - if (!$retain && $n) { - assert($n->prev !== null); - $n->prev->readers ^= ($n->prev->readers & 1 | 1) << $reader; - $this->tryUnlink($n); - } - - return $metric; - } - - private function tryUnlink(Delta $n): void - { - assert($n->prev !== null); - /** @phpstan-ignore-next-line */ - if ($n->prev->readers == 0) { - $n->prev = $n->prev->prev; - - return; - } - - for ($c = $n->prev->prev; - $c && ($n->prev->readers & $c->readers) == 0; - $c = $c->prev) { - } - - if ($c && $n->prev->readers === $c->readers) { - $this->mergeInto($c->metric, $n->prev->metric); - $n->prev = $n->prev->prev; - } - } - - private function mergeInto(Metric $into, Metric $metric): void - { - foreach ($metric->summaries as $k => $summary) { - $into->attributes[$k] ??= $metric->attributes[$k]; - $into->summaries[$k] = isset($into->summaries[$k]) - ? $this->aggregation->merge($into->summaries[$k], $summary) - : $summary; - } - $into->exemplars += $metric->exemplars; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/Metric.php b/vendor/open-telemetry/sdk/Metrics/Stream/Metric.php deleted file mode 100644 index 6b1db9eef..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/Metric.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ - public array $attributes; - /** - * @var array - */ - public array $summaries; - public int $timestamp; - /** - * @var array - */ - public array $exemplars; - - /** - * @param array $attributes - * @param array $summaries - * @param array $exemplars - */ - public function __construct(array $attributes, array $summaries, int $timestamp, array $exemplars = []) - { - $this->attributes = $attributes; - $this->summaries = $summaries; - $this->timestamp = $timestamp; - $this->exemplars = $exemplars; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php deleted file mode 100644 index b1328eb07..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php +++ /dev/null @@ -1,73 +0,0 @@ - */ - private array $attributes = []; - private array $summaries = []; - - public function __construct( - ?AttributeProcessorInterface $attributeProcessor, - AggregationInterface $aggregation, - ?ExemplarReservoirInterface $exemplarReservoir = null - ) { - $this->attributeProcessor = $attributeProcessor; - $this->aggregation = $aggregation; - $this->exemplarReservoir = $exemplarReservoir; - } - - /** - * @param float|int $value - */ - public function record($value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void - { - $filteredAttributes = $this->attributeProcessor !== null - ? $this->attributeProcessor->process($attributes, $context) - : $attributes; - $raw = $filteredAttributes->toArray(); - $index = $raw !== [] ? serialize($raw) : 0; - $this->attributes[$index] ??= $filteredAttributes; - $this->aggregation->record( - $this->summaries[$index] ??= $this->aggregation->initialize(), - $value, - $attributes, - $context, - $timestamp, - ); - - if ($this->exemplarReservoir !== null) { - $this->exemplarReservoir->offer($index, $value, $attributes, $context, $timestamp); - } - } - - public function collect(int $timestamp): Metric - { - $exemplars = $this->exemplarReservoir - ? $this->exemplarReservoir->collect($this->attributes) - : []; - $metric = new Metric($this->attributes, $this->summaries, $timestamp, $exemplars); - - $this->attributes = []; - $this->summaries = []; - - return $metric; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php deleted file mode 100644 index 5866a72b7..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php +++ /dev/null @@ -1,28 +0,0 @@ -attributeProcessor = $attributeProcessor; - $this->aggregation = $aggregation; - } - - public function create(): MetricAggregatorInterface - { - return new MetricAggregator($this->attributeProcessor, $this->aggregation); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php deleted file mode 100644 index 356f682f2..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -aggregation = $aggregation; - $this->timestamp = $startTimestamp; - $this->delta = new DeltaStorage($aggregation); - } - - public function temporality() - { - return Temporality::DELTA; - } - - public function timestamp(): int - { - return $this->timestamp; - } - - public function push(Metric $metric): void - { - [$this->timestamp, $metric->timestamp] = [$metric->timestamp, $this->timestamp]; - $this->delta->add($metric, $this->readers); - } - - public function register($temporality): int - { - $reader = 0; - for ($r = $this->readers; ($r & 1) != 0; $r >>= 1, $reader++) { - } - - if ($reader === (PHP_INT_SIZE << 3) - 1 && is_int($this->readers)) { - if (!extension_loaded('gmp')) { - trigger_error(sprintf('GMP extension required to register over %d readers', (PHP_INT_SIZE << 3) - 1), E_USER_WARNING); - $reader = PHP_INT_SIZE << 3; - } else { - assert(is_int($this->cumulative)); - $this->readers = gmp_init($this->readers); - $this->cumulative = gmp_init($this->cumulative); - } - } - - $readerMask = ($this->readers & 1 | 1) << $reader; - $this->readers ^= $readerMask; - if ($temporality === Temporality::CUMULATIVE) { - $this->cumulative ^= $readerMask; - } - - return $reader; - } - - public function unregister(int $reader): void - { - $readerMask = ($this->readers & 1 | 1) << $reader; - if (($this->readers & $readerMask) == 0) { - return; - } - - $this->delta->collect($reader); - - $this->readers ^= $readerMask; - if (($this->cumulative & $readerMask) != 0) { - $this->cumulative ^= $readerMask; - } - } - - public function collect(int $reader): DataInterface - { - $cumulative = ($this->cumulative >> $reader & 1) != 0; - $metric = $this->delta->collect($reader, $cumulative) ?? new Metric([], [], $this->timestamp); - - $temporality = $cumulative - ? Temporality::CUMULATIVE - : Temporality::DELTA; - - return $this->aggregation->toData( - $metric->attributes, - $metric->summaries, - Exemplar::groupByIndex($metric->exemplars), - $metric->timestamp, - $this->timestamp, - $temporality, - ); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php b/vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php deleted file mode 100644 index 9fd425a44..000000000 --- a/vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -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); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php b/vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php deleted file mode 100644 index f387abf9c..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php +++ /dev/null @@ -1,40 +0,0 @@ - */ - private array $criteria = []; - /** @var list */ - private array $views = []; - - public function register(SelectionCriteriaInterface $criteria, ViewTemplate $view): void - { - $this->criteria[] = $criteria; - $this->views[] = $view; - } - - public function find(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): ?iterable - { - $views = $this->generateViews($instrument, $instrumentationScope); - - return $views->valid() ? $views : null; - } - - private function generateViews(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): Generator - { - foreach ($this->criteria as $i => $criteria) { - if ($criteria->accepts($instrument, $instrumentationScope)) { - yield $this->views[$i]->project($instrument); - } - } - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php deleted file mode 100644 index 438297324..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php +++ /dev/null @@ -1,33 +0,0 @@ - $criteria - */ - public function __construct(iterable $criteria) - { - $this->criteria = $criteria; - } - - public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool - { - foreach ($this->criteria as $criterion) { - if (!$criterion->accepts($instrument, $instrumentationScope)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php deleted file mode 100644 index ed6034755..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php +++ /dev/null @@ -1,28 +0,0 @@ -pattern = sprintf('/^%s$/', strtr(preg_quote($name, '/'), ['\\?' => '.', '\\*' => '.*'])); - } - - public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool - { - return (bool) preg_match($this->pattern, $instrument->name); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php deleted file mode 100644 index 46a88def0..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php +++ /dev/null @@ -1,29 +0,0 @@ -instrumentTypes = (array) $instrumentType; - } - - public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool - { - return in_array($instrument->type, $this->instrumentTypes, true); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php deleted file mode 100644 index 201d1a7b2..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php +++ /dev/null @@ -1,24 +0,0 @@ -name = $name; - } - - public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool - { - return $this->name === $instrumentationScope->getName(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php deleted file mode 100644 index a11a1d589..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php +++ /dev/null @@ -1,24 +0,0 @@ -schemaUrl = $schemaUrl; - } - - public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool - { - return $this->schemaUrl === $instrumentationScope->getSchemaUrl(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php deleted file mode 100644 index 37d180f99..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php +++ /dev/null @@ -1,24 +0,0 @@ -version = $version; - } - - public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool - { - return $this->version === $instrumentationScope->getVersion(); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php deleted file mode 100644 index 8abd6fa69..000000000 --- a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php +++ /dev/null @@ -1,13 +0,0 @@ - - */ - private ?array $attributeKeys = null; - private ?AggregationInterface $aggregation = null; - - private function __construct() - { - } - - public static function create(): self - { - static $instance; - - return $instance ??= new self(); - } - - public function withName(string $name): self - { - $self = clone $this; - $self->name = $name; - - return $self; - } - - public function withDescription(string $description): self - { - $self = clone $this; - $self->description = $description; - - return $self; - } - - /** - * @param list $attributeKeys - */ - public function withAttributeKeys(array $attributeKeys): self - { - $self = clone $this; - $self->attributeKeys = $attributeKeys; - - return $self; - } - - public function withAggregation(?AggregationInterface $aggregation): self - { - $self = clone $this; - $self->aggregation = $aggregation; - - return $self; - } - - public function project(Instrument $instrument): ViewProjection - { - return new ViewProjection( - $this->name ?? $instrument->name, - $instrument->unit, - $this->description ?? $instrument->description, - $this->attributeKeys, - $this->aggregation, - ); - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/ViewProjection.php b/vendor/open-telemetry/sdk/Metrics/ViewProjection.php deleted file mode 100644 index 046bd6bb1..000000000 --- a/vendor/open-telemetry/sdk/Metrics/ViewProjection.php +++ /dev/null @@ -1,47 +0,0 @@ -|null - */ - public ?array $attributeKeys; - /** - * @readonly - */ - public ?AggregationInterface $aggregation; - - /** - * @param list|null $attributeKeys - */ - public function __construct( - string $name, - ?string $unit, - ?string $description, - ?array $attributeKeys, - ?AggregationInterface $aggregation - ) { - $this->name = $name; - $this->unit = $unit; - $this->description = $description; - $this->attributeKeys = $attributeKeys; - $this->aggregation = $aggregation; - } -} diff --git a/vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php b/vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php deleted file mode 100644 index 19d8f9ffd..000000000 --- a/vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -|null - */ - public function find(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): ?iterable; -} -- cgit v1.2.3-54-g00ecf