Skip to content

Commit 4916f47

Browse files
committed
Fix tiny issue of doc in RandomRatioBased
1 parent f44e967 commit 4916f47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/tracing/sampler/sampling.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type RandomRatioBased struct {
1717
fraction float64
1818
}
1919

20-
// NewRandomRatioBased crea
20+
// NewRandomRatioBased creates a sampler based on random number.
2121
// fraction parameter should be between 0 and 1 where:
2222
// fraction >= 1 it will always sample
2323
// fraction <= 0 it will never sample
@@ -31,6 +31,7 @@ func NewRandomRatioBased(fraction float64, rnd randGenerator) sdktrace.Sampler {
3131
return &RandomRatioBased{rnd: rnd, fraction: fraction}
3232
}
3333

34+
// ShouldSample impleents sdktrace.Sampler.ShouldSample.
3435
func (s *RandomRatioBased) ShouldSample(p sdktrace.SamplingParameters) sdktrace.SamplingResult {
3536
psc := trace.SpanContextFromContext(p.ParentContext)
3637
shouldSample := s.rnd.Float64() < s.fraction
@@ -46,6 +47,7 @@ func (s *RandomRatioBased) ShouldSample(p sdktrace.SamplingParameters) sdktrace.
4647
}
4748
}
4849

50+
// Description implements sdktrace.Sampler.Description.
4951
func (s *RandomRatioBased) Description() string {
5052
return fmt.Sprintf("RandomRatioBased{%g}", s.fraction)
5153
}

0 commit comments

Comments
 (0)