From cdd7ad020e165fe680703b6d3319b908b682fb7a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 20 Oct 2023 17:12:29 +0300 Subject: jaeger-client -> opentelemetry --- .../src/Jaeger/Sampler/ProbabilisticSampler.php | 88 ---------------------- 1 file changed, 88 deletions(-) delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php (limited to 'vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php') diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php deleted file mode 100644 index cb265d01e..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php +++ /dev/null @@ -1,88 +0,0 @@ -tags = [ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_PROBABILISTIC, - SAMPLER_PARAM_TAG_KEY => $rate, - ]; - - if ($rate < 0.0 || $rate > 1.0) { - throw new OutOfBoundsException('Sampling rate must be between 0.0 and 1.0.'); - } - - $this->rate = $rate; - if ($rate < 0.5) { - $this->boundary = (int)($rate * PHP_INT_MAX); - } else { - // more precise calculation due to int and float having different precision near PHP_INT_MAX - $this->boundary = PHP_INT_MAX - (int)((1 - $rate) * PHP_INT_MAX); - } - } - - /** - * {@inheritdoc} - * - * @param string $traceId The traceId on the span. - * @param string $operation The operation name set on the span. - * @return array - */ - public function isSampled(string $traceId, string $operation = ''): array - { - return [($traceId < $this->boundary), $this->tags]; - } - - /** - * {@inheritdoc} - * - * Only implemented to satisfy the sampler interface. - * - * @return void - */ - public function close() - { - // nothing to do - } -} -- cgit v1.2.3