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

Breadcrumb

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

function Meter::viewRegistrationRequests

Return value

iterable<array{ViewProjection, MetricRegistrationInterface}>

3 calls to Meter::viewRegistrationRequests()
Meter::createAsynchronousObserver in vendor/open-telemetry/sdk/Metrics/Meter.php
Meter::createSynchronousWriter in vendor/open-telemetry/sdk/Metrics/Meter.php
Meter::updateConfigurator in vendor/open-telemetry/sdk/Metrics/Meter.php
@internal

File

vendor/open-telemetry/sdk/Metrics/Meter.php, line 399

Class

Meter
@internal

Namespace

OpenTelemetry\SDK\Metrics

Code

private function viewRegistrationRequests(Instrument $instrument, StalenessHandlerInterface $stalenessHandler) : iterable {
    $views = $this->viewRegistry
        ->find($instrument, $this->instrumentationScope) ?? [
        new ViewProjection($instrument->name, $instrument->unit, $instrument->description, null, null),
    ];
    $compositeRegistration = new MultiRegistryRegistration($this->metricRegistries, $stalenessHandler);
    foreach ($views as $view) {
        if ($view->aggregation !== null) {
            (yield [
                $view,
                $compositeRegistration,
            ]);
        }
        else {
            foreach ($this->metricRegistries as $metricRegistry) {
                (yield [
                    new ViewProjection($view->name, $view->unit, $view->description, $view->attributeKeys, $metricRegistry->defaultAggregation($instrument->type, $instrument->advisory)),
                    new RegistryRegistration($metricRegistry, $stalenessHandler),
                ]);
            }
        }
    }
}

API Navigation

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