MCPcopy
hub / github.com/grafana/tempo / Estimate

Method Estimate

modules/generator/registry/cardinality.go:96–103  ·  view source on GitHub ↗

Estimate returns the estimated cardinality over the last staleTime window.

()

Source from the content-addressed store, hash-verified

94
95// Estimate returns the estimated cardinality over the last staleTime window.
96func (c *Cardinality) Estimate() uint64 {
97 c.mu.RLock()
98 window := c.cachedMerge.Clone()
99 current := c.sketches[c.current].Clone()
100 c.mu.RUnlock()
101 _ = window.Merge(current)
102 return window.Estimate()
103}
104
105// Advance should be called by an external ticker every sketchDuration to advance the ring.
106// It advances at least 1 step per call.

Calls 2

CloneMethod · 0.80
MergeMethod · 0.80