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

Breadcrumb

  1. Drupal Core 11.1.x

StreamMetricSource.php

Namespace

OpenTelemetry\SDK\Metrics\MetricFactory

File

vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php

View source
<?php

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

use OpenTelemetry\SDK\Metrics\Data\Metric;
use OpenTelemetry\SDK\Metrics\MetricSourceInterface;

/**
 * @internal
 */
final class StreamMetricSource implements MetricSourceInterface {
    public function __construct(StreamMetricSourceProvider $provider, int $reader) {
    }
    public function collectionTimestamp() : int {
        return $this->provider->stream
            ->timestamp();
    }
    public function collect() : Metric {
        return new Metric($this->provider->instrumentationLibrary, $this->provider->resource, $this->provider->view->name, $this->provider->view->unit, $this->provider->view->description, $this->provider->stream
            ->collect($this->reader));
    }
    public function __destruct() {
        $this->provider->stream
            ->unregister($this->reader);
    }

}

Classes

Title Deprecated Summary
StreamMetricSource @internal

API Navigation

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