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

Breadcrumb

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

function MetricConverter::convertHistogramDataPoint

1 call to MetricConverter::convertHistogramDataPoint()
MetricConverter::convertHistogram in vendor/open-telemetry/exporter-otlp/MetricConverter.php

File

vendor/open-telemetry/exporter-otlp/MetricConverter.php, line 199

Class

MetricConverter

Namespace

OpenTelemetry\Contrib\Otlp

Code

private function convertHistogramDataPoint(SDK\Metrics\Data\HistogramDataPoint $dataPoint) : HistogramDataPoint {
    $pHistogramDataPoint = new HistogramDataPoint();
    $this->setAttributes($pHistogramDataPoint, $dataPoint->attributes);
    $pHistogramDataPoint->setStartTimeUnixNano($dataPoint->startTimestamp);
    $pHistogramDataPoint->setTimeUnixNano($dataPoint->timestamp);
    $pHistogramDataPoint->setCount($dataPoint->count);
    $pHistogramDataPoint->setSum($dataPoint->sum);
    
    /** @phpstan-ignore-next-line */
    $pHistogramDataPoint->setBucketCounts($dataPoint->bucketCounts);
    
    /** @phpstan-ignore-next-line */
    $pHistogramDataPoint->setExplicitBounds($dataPoint->explicitBounds);
    foreach ($dataPoint->exemplars as $exemplar) {
        
        /** @psalm-suppress InvalidArgument */
        $pHistogramDataPoint->getExemplars()[] = $this->convertExemplar($exemplar);
    }
    return $pHistogramDataPoint;
}

API Navigation

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