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

Breadcrumb

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

function MetricRegistry::record

Overrides MetricWriterInterface::record

File

vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistry.php, line 93

Class

MetricRegistry
@internal

Namespace

OpenTelemetry\SDK\Metrics\MetricRegistry

Code

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);
        }
    }
}

API Navigation

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