mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
metrics: add benchmarks
This commit is contained in:
parent
53f3c2ae65
commit
769aad4126
1 changed files with 12 additions and 0 deletions
|
|
@ -14,6 +14,18 @@ func BenchmarkEWMA(b *testing.B) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BenchmarkEWMAParallel(b *testing.B) {
|
||||||
|
a := NewEWMA1()
|
||||||
|
b.ResetTimer()
|
||||||
|
|
||||||
|
b.RunParallel(func(pb *testing.PB) {
|
||||||
|
for pb.Next() {
|
||||||
|
a.Update(1)
|
||||||
|
a.Tick()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func TestEWMA1(t *testing.T) {
|
func TestEWMA1(t *testing.T) {
|
||||||
a := NewEWMA1()
|
a := NewEWMA1()
|
||||||
a.Update(3)
|
a.Update(3)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue