mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
metrics: add sleep to test in order to get predictable output
This commit is contained in:
parent
52bb0a1ec7
commit
abc63fda57
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"log"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
const FANOUT = 128
|
||||
|
|
@ -114,7 +115,7 @@ func Example() {
|
|||
|
||||
// Threadsafe registration
|
||||
t := GetOrRegisterTimer("db.get.latency", nil)
|
||||
t.Time(func() {})
|
||||
t.Time(func() { time.Sleep(10 * time.Millisecond) })
|
||||
t.Update(1)
|
||||
|
||||
fmt.Println(c.Count())
|
||||
|
|
|
|||
Loading…
Reference in a new issue