etcd/storage/watcher_bench_test.go
Yicheng Qin ec43e0a4c3 storage: introduce WatchableKV and watch feature
WatchableKV is an interface upon KV, and supports watch feature.
2015-09-14 23:53:03 -07:00

18 lines
281 B
Go

package storage
import (
"fmt"
"testing"
)
func BenchmarkKVWatcherMemoryUsage(b *testing.B) {
s := newWatchableStore(tmpPath)
defer cleanup(s, tmpPath)
b.ReportAllocs()
b.StartTimer()
for i := 0; i < b.N; i++ {
s.Watcher([]byte(fmt.Sprint("foo", i)), false, 0, 0)
}
}