MediaWiki master
|
A SamplerInterface
implementation that samples a given percentage of root spans, while respecting sampling decisions made by other samplers for a given trace.
More...
Inherits Wikimedia\Telemetry\SamplerInterface.
Public Member Functions | ||||
__construct (int $percentChance) | ||||
shouldSample (?SpanContext $parentSpanContext) | ||||
Determine whether a newly created span should be sampled based on its parent span data.
| ||||
A SamplerInterface
implementation that samples a given percentage of root spans, while respecting sampling decisions made by other samplers for a given trace.
Definition at line 13 of file ProbabilisticSampler.php.
Wikimedia\Telemetry\ProbabilisticSampler::__construct | ( | int | $percentChance | ) |
Definition at line 20 of file ProbabilisticSampler.php.
Wikimedia\Telemetry\ProbabilisticSampler::shouldSample | ( | ?SpanContext | $parentSpanContext | ) |
Determine whether a newly created span should be sampled based on its parent span data.
SpanContext | null | $parentSpanContext | Context of he parent span of the newly created span, or null if the newly created span is a root span. |
Implements Wikimedia\Telemetry\SamplerInterface.
Definition at line 30 of file ProbabilisticSampler.php.
References Wikimedia\Telemetry\SpanContext\isSampled().