mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
cmd/swarm/swarm-smoke: metrics for each run (#1049)
This commit is contained in:
parent
b38fd0c332
commit
a43801c636
1 changed files with 6 additions and 0 deletions
|
|
@ -123,11 +123,14 @@ func uploadAndSync(c *cli.Context) error {
|
|||
wg.Add(1)
|
||||
go func(endpoint string, ruid string) {
|
||||
for {
|
||||
start := time.Now()
|
||||
err := fetch(hash, endpoint, fhash, ruid)
|
||||
fetchTime := time.Since(start)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
metrics.GetOrRegisterMeter("upload-and-sync.single.fetch-time", nil).Mark(int64(fetchTime))
|
||||
wg.Done()
|
||||
return
|
||||
}
|
||||
|
|
@ -138,11 +141,14 @@ func uploadAndSync(c *cli.Context) error {
|
|||
wg.Add(1)
|
||||
go func(endpoint string, ruid string) {
|
||||
for {
|
||||
start := time.Now()
|
||||
err := fetch(hash, endpoint, fhash, ruid)
|
||||
fetchTime := time.Since(start)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
metrics.GetOrRegisterMeter("upload-and-sync.each.fetch-time", nil).Mark(int64(fetchTime))
|
||||
wg.Done()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue