mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
18 lines
281 B
Go
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)
|
|
}
|
|
}
|