Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HistogramBucketReservoir.php

class HistogramBucketReservoir

Hierarchy

  • class \OpenTelemetry\SDK\Metrics\Exemplar\HistogramBucketReservoir implements \OpenTelemetry\SDK\Metrics\Exemplar\ExemplarReservoirInterface

Expanded class hierarchy of HistogramBucketReservoir

1 file declares its use of HistogramBucketReservoir
StreamFactory.php in vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php

File

vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php, line 11

Namespace

OpenTelemetry\SDK\Metrics\Exemplar
View source
final class HistogramBucketReservoir implements ExemplarReservoirInterface {
    private readonly BucketStorage $storage;
    
    /**
     * @var list<float|int>
     */
    private array $boundaries;
    
    /**
     * @param list<float|int> $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);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
HistogramBucketReservoir::$boundaries private property
HistogramBucketReservoir::$storage private property
HistogramBucketReservoir::collect public function Overrides ExemplarReservoirInterface::collect
HistogramBucketReservoir::offer public function Overrides ExemplarReservoirInterface::offer
HistogramBucketReservoir::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal