MCPcopy Create free account
hub / github.com/buraksezer/consistent / BenchmarkLocateKey

Function BenchmarkLocateKey

consistent_test.go:197–207  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

195}
196
197func BenchmarkLocateKey(b *testing.B) {
198 cfg := newConfig()
199 c := New(nil, cfg)
200 c.Add(testMember("node1"))
201 c.Add(testMember("node2"))
202 b.ResetTimer()
203 for i := 0; i < b.N; i++ {
204 key := []byte("key" + strconv.Itoa(i))
205 c.LocateKey(key)
206 }
207}
208
209func BenchmarkGetClosestN(b *testing.B) {
210 cfg := newConfig()

Callers

nothing calls this directly

Calls 5

newConfigFunction · 0.85
NewFunction · 0.85
testMemberTypeAlias · 0.85
AddMethod · 0.80
LocateKeyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…