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

Breadcrumb

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

function TraceIdRatioBasedSampler::__construct

Parameters

float $probability Probability float value between 0.0 and 1.0.:

File

vendor/open-telemetry/sdk/Trace/Sampler/TraceIdRatioBasedSampler.php, line 29

Class

TraceIdRatioBasedSampler
This implementation of the SamplerInterface records with given probability. Example: ``` use OpenTelemetry\API\Trace\TraceIdRatioBasedSampler; $sampler = new TraceIdRatioBasedSampler(0.01); ```

Namespace

OpenTelemetry\SDK\Trace\Sampler

Code

public function __construct(float $probability) {
    if ($probability < 0.0 || $probability > 1.0) {
        throw new InvalidArgumentException('probability should be be between 0.0 and 1.0.');
    }
    $this->probability = $probability;
}

API Navigation

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