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

Function BenchmarkUpdateRingState

pkg/ring/ring_test.go:108–120  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

106}
107
108func BenchmarkUpdateRingState(b *testing.B) {
109 for _, numInstances := range []int{50, 100, 500} {
110 for _, numZones := range []int{1, 3} {
111 for _, numTokens := range []int{128, 256, 512} {
112 for _, updateTokens := range []bool{false, true} {
113 b.Run(fmt.Sprintf("num instances = %d, num zones = %d, num tokens = %d, update tokens = %t", numInstances, numZones, numTokens, updateTokens), func(b *testing.B) {
114 benchmarkUpdateRingState(b, NewRandomTokenGenerator(), numInstances, numZones, numTokens, updateTokens)
115 })
116 }
117 }
118 }
119 }
120}
121
122func benchmarkUpdateRingState(b *testing.B, g TokenGenerator, numInstances, numZones, numTokens int, updateTokens bool) {
123 cfg := Config{

Callers

nothing calls this directly

Calls 3

benchmarkUpdateRingStateFunction · 0.85
NewRandomTokenGeneratorFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected