Print totals in mpool stat
This commit is contained in:
parent
d557c407c6
commit
d0f4ede99b
11
cli/mpool.go
11
cli/mpool.go
@ -225,10 +225,19 @@ var mpoolStat = &cli.Command{
|
||||
return out[i].addr < out[j].addr
|
||||
})
|
||||
|
||||
var total mpStat
|
||||
|
||||
for _, stat := range out {
|
||||
fmt.Printf("%s, past: %d, cur: %d, future: %d\n", stat.addr, stat.past, stat.cur, stat.future)
|
||||
total.past += stat.past
|
||||
total.cur += stat.cur
|
||||
total.future += stat.future
|
||||
|
||||
fmt.Printf("%s: past: %d, cur: %d, future: %d\n", stat.addr, stat.past, stat.cur, stat.future)
|
||||
}
|
||||
|
||||
fmt.Println("-----")
|
||||
fmt.Printf("total: past: %d, cur: %d, future: %d\n", total.past, total.cur, total.future)
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user