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

Breadcrumb

  1. Drupal Core 11.1.x

FilteredReservoir.php

Namespace

OpenTelemetry\SDK\Metrics\Exemplar

File

vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php

View source
<?php

declare (strict_types=1);
namespace OpenTelemetry\SDK\Metrics\Exemplar;

use OpenTelemetry\Context\ContextInterface;
use OpenTelemetry\SDK\Common\Attribute\AttributesInterface;

/**
 * The exemplar spec is not yet stable, and can change at any time.
 * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#exemplar
 */
final class FilteredReservoir implements ExemplarReservoirInterface {
    public function __construct(ExemplarReservoirInterface $reservoir, ExemplarFilterInterface $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);
    }

}

Classes

Title Deprecated Summary
FilteredReservoir The exemplar spec is not yet stable, and can change at any time.

API Navigation

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