summaryrefslogtreecommitdiff
path: root/vendor/github.com/uber/jaeger-client-go/sampler.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-08 21:34:06 +0200
committerGitHub <noreply@github.com>2020-05-08 21:34:06 +0200
commit7f8b31f5fb59d8b66a26dcd822863fbc18687905 (patch)
tree02ba6090ce80e17cb29d74feb44e43d5ff16090f /vendor/github.com/uber/jaeger-client-go/sampler.go
parentaa74c3f09223107b85b6538a1ffe1e359ff51a65 (diff)
parent5be55739ccf2435e96b52ca64ce1627506927069 (diff)
downloadpodman-7f8b31f5fb59d8b66a26dcd822863fbc18687905.tar.gz
podman-7f8b31f5fb59d8b66a26dcd822863fbc18687905.tar.bz2
podman-7f8b31f5fb59d8b66a26dcd822863fbc18687905.zip
Merge pull request #6049 from containers/dependabot/go_modules/github.com/uber/jaeger-client-go-2.23.1incompatible
build(deps): bump github.com/uber/jaeger-client-go from 2.22.1+incompatible to 2.23.1+incompatible
Diffstat (limited to 'vendor/github.com/uber/jaeger-client-go/sampler.go')
-rw-r--r--vendor/github.com/uber/jaeger-client-go/sampler.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/vendor/github.com/uber/jaeger-client-go/sampler.go b/vendor/github.com/uber/jaeger-client-go/sampler.go
index f47004b1f..d0be8ad50 100644
--- a/vendor/github.com/uber/jaeger-client-go/sampler.go
+++ b/vendor/github.com/uber/jaeger-client-go/sampler.go
@@ -17,6 +17,7 @@ package jaeger
import (
"fmt"
"math"
+ "strings"
"sync"
"github.com/uber/jaeger-client-go/thrift-gen/sampling"
@@ -141,7 +142,7 @@ func (s *ProbabilisticSampler) SamplingRate() float64 {
// IsSampled implements IsSampled() of Sampler.
func (s *ProbabilisticSampler) IsSampled(id TraceID, operation string) (bool, []Tag) {
- return s.samplingBoundary >= id.Low, s.tags
+ return s.samplingBoundary >= id.Low&maxRandomNumber, s.tags
}
// Close implements Close() of Sampler.
@@ -319,6 +320,10 @@ func (s *GuaranteedThroughputProbabilisticSampler) update(lowerBound, samplingRa
}
}
+func (s GuaranteedThroughputProbabilisticSampler) String() string {
+ return fmt.Sprintf("GuaranteedThroughputProbabilisticSampler(lowerBound=%f, samplingRate=%f)", s.lowerBound, s.samplingRate)
+}
+
// -----------------------
// PerOperationSampler is a delegating sampler that applies GuaranteedThroughputProbabilisticSampler
@@ -456,6 +461,23 @@ func (s *PerOperationSampler) Close() {
s.defaultSampler.Close()
}
+func (s *PerOperationSampler) String() string {
+ var sb strings.Builder
+
+ fmt.Fprintf(&sb, "PerOperationSampler(defaultSampler=%v, ", s.defaultSampler)
+ fmt.Fprintf(&sb, "lowerBound=%f, ", s.lowerBound)
+ fmt.Fprintf(&sb, "maxOperations=%d, ", s.maxOperations)
+ fmt.Fprintf(&sb, "operationNameLateBinding=%t, ", s.operationNameLateBinding)
+ fmt.Fprintf(&sb, "numOperations=%d,\n", len(s.samplers))
+ fmt.Fprintf(&sb, "samplers=[")
+ for operationName, sampler := range s.samplers {
+ fmt.Fprintf(&sb, "\n(operationName=%s, sampler=%v)", operationName, sampler)
+ }
+ fmt.Fprintf(&sb, "])")
+
+ return sb.String()
+}
+
// Equal is not used.
// TODO (breaking change) remove this in the future
func (s *PerOperationSampler) Equal(other Sampler) bool {