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

Function NewDistinctString

pkg/collector/distinct_string_collector.go:28–36  ·  view source on GitHub ↗

NewDistinctString with the given maximum data size and max items. MaxDataSize is calculated as the total length of the recorded strings. For ease of use, maxDataSize=0 and maxItems=0 are interpreted as unlimited.

(maxDataSize int, maxValues uint32, staleValueThreshold uint32)

Source from the content-addressed store, hash-verified

26// MaxDataSize is calculated as the total length of the recorded strings.
27// For ease of use, maxDataSize=0 and maxItems=0 are interpreted as unlimited.
28func NewDistinctString(maxDataSize int, maxValues uint32, staleValueThreshold uint32) *DistinctString {
29 return &DistinctString{
30 values: make(map[string]struct{}),
31 maxDataSize: maxDataSize,
32 diffEnabled: false, // disable diff to make it faster
33 maxValues: maxValues,
34 maxCacheHits: staleValueThreshold,
35 }
36}
37
38// NewDistinctStringWithDiff is like NewDistinctString but with diff support enabled.
39// MaxDataSize is calculated as the total length of the recorded strings.

Callers 15

SearchTagValuesMethod · 0.92
SearchTagsMethod · 0.92
SearchTagValuesMethod · 0.92
SearchTagsBlocksMethod · 0.92
SearchTagsMethod · 0.92
SearchTagValuesMethod · 0.92

Calls

no outgoing calls