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

Function NewScopedDistinctString

pkg/collector/scoped_distinct_string.go:26–35  ·  view source on GitHub ↗

NewScopedDistinctString collects the tags per scope MaxDataSize is calculated as the total length of the recorded strings. MaxTagsPerScope controls how many tags can be added per scope. The intrinsic scope is unbounded. For ease of use, maxDataSize=0 and maxTagsPerScope=0 are interpreted as unlimite

(maxDataSize int, maxTagsPerScope uint32, staleValueThreshold uint32)

Source from the content-addressed store, hash-verified

24// MaxTagsPerScope controls how many tags can be added per scope. The intrinsic scope is unbounded.
25// For ease of use, maxDataSize=0 and maxTagsPerScope=0 are interpreted as unlimited.
26func NewScopedDistinctString(maxDataSize int, maxTagsPerScope uint32, staleValueThreshold uint32) *ScopedDistinctString {
27 return &ScopedDistinctString{
28 cols: map[string]*DistinctString{},
29 newCol: NewDistinctString,
30 maxDataSize: maxDataSize,
31 diffEnabled: false,
32 maxTagsPerScope: maxTagsPerScope,
33 maxCacheHits: staleValueThreshold,
34 }
35}
36
37// NewScopedDistinctStringWithDiff collects the tags per scope with diff
38// MaxDataSize is calculated as the total length of the recorded strings.

Callers 15

SearchTagsMethod · 0.92
tagNamesRunnerFunction · 0.92
TestFetchTagNamesFunction · 0.92
BenchmarkFetchTagsFunction · 0.92
TestFetchTagNamesFunction · 0.92
BenchmarkFetchTagsFunction · 0.92
TestFetchTagNamesFunction · 0.92
BenchmarkFetchTagsFunction · 0.92
naiveTagsV2CombineFunction · 0.92

Calls

no outgoing calls

Tested by 15

tagNamesRunnerFunction · 0.74
TestFetchTagNamesFunction · 0.74
BenchmarkFetchTagsFunction · 0.74
TestFetchTagNamesFunction · 0.74
BenchmarkFetchTagsFunction · 0.74
TestFetchTagNamesFunction · 0.74
BenchmarkFetchTagsFunction · 0.74
naiveTagsV2CombineFunction · 0.74
TestScopedDistinctFunction · 0.68