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

Breadcrumb

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

function AsynchronousMetricStream::collect

Overrides MetricStreamInterface::collect

File

vendor/open-telemetry/sdk/Metrics/Stream/AsynchronousMetricStream.php, line 70

Class

AsynchronousMetricStream
@internal

Namespace

OpenTelemetry\SDK\Metrics\Stream

Code

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

API Navigation

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