MCPcopy
hub / github.com/grafana/dskit / newRingForTesting

Function newRingForTesting

ring/ring_test.go:37–48  ·  view source on GitHub ↗
(cfg Config, createCacheMaps bool)

Source from the content-addressed store, hash-verified

35)
36
37func newRingForTesting(cfg Config, createCacheMaps bool) *Ring {
38 ring := Ring{
39 cfg: cfg,
40 trackedRingZones: make(map[string]struct{}),
41 strategy: NewDefaultReplicationStrategy(),
42 }
43 if createCacheMaps {
44 ring.shuffledSubringCache = map[subringCacheKey]*Ring{}
45 ring.shuffledSubringWithLookbackCache = map[subringCacheKey]cachedSubringWithLookback[*Ring]{}
46 }
47 return &ring
48}
49
50func BenchmarkBatch10x100(b *testing.B) {
51 benchmarkBatch(b, 10, 100)

Calls 1

Tested by

no test coverage detected