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

Breadcrumb

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

function FixedSizeReservoir::offer

Overrides ExemplarReservoirInterface::offer

File

vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php, line 23

Class

FixedSizeReservoir

Namespace

OpenTelemetry\SDK\Metrics\Exemplar

Code

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);
    }
}
RSS feed
Powered by Drupal