MCPcopy Index your code
hub / github.com/ContentSquare/chproxy / BenchmarkKeyString

Function BenchmarkKeyString

cache/key_test.go:121–136  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

119var Sink uint32
120
121func BenchmarkKeyString(b *testing.B) {
122 k := Key{
123 Query: []byte("SELECT 1 FROM system.numbers LIMIT 10"),
124 AcceptEncoding: "gzip",
125 DefaultFormat: "JSON",
126 Database: "foobar",
127 }
128 b.RunParallel(func(pb *testing.PB) {
129 n := 0
130 for pb.Next() {
131 s := k.String()
132 n += len(s)
133 }
134 atomic.AddUint32(&Sink, uint32(n))
135 })
136}

Callers

nothing calls this directly

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected