MCPcopy Index your code
hub / github.com/cortexproject/cortex / NewLruInterner

Function NewLruInterner

pkg/util/strings.go:149–156  ·  view source on GitHub ↗

NewLruInterner returns a new Interner to be used to intern strings. The interner will use a LRU cache to return the deduplicated strings

(enabled bool)

Source from the content-addressed store, hash-verified

147// NewLruInterner returns a new Interner to be used to intern strings.
148// The interner will use a LRU cache to return the deduplicated strings
149func NewLruInterner(enabled bool) Interner {
150 if !enabled {
151 return &noOpInterner{}
152 }
153 return &pool{
154 lru: expirable.NewLRU[string, string](maxInternerLruCacheSize, nil, internerLruCacheTTL),
155 }
156}
157
158type noOpInterner struct{}
159

Callers 1

createTSDBMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected