mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
small fix on metering function
This commit is contained in:
parent
e869586e13
commit
0f09a8c690
1 changed files with 4 additions and 4 deletions
|
|
@ -7,8 +7,8 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
avgAccessDepthInBlock = metrics.NewRegisteredMeter("trie/access/depth/avg", nil)
|
||||
minAccessDepthInBlock = metrics.NewRegisteredMeter("trie/access/depth/min", nil)
|
||||
avgAccessDepthInBlock = metrics.NewRegisteredGauge("trie/access/depth/avg", nil)
|
||||
minAccessDepthInBlock = metrics.NewRegisteredGauge("trie/access/depth/min", nil)
|
||||
stateDepthAggregator = &depthAggregator{}
|
||||
)
|
||||
|
||||
|
|
@ -44,8 +44,8 @@ func (d *depthAggregator) end() {
|
|||
sum, cnt, min := d.sum, d.cnt, d.min
|
||||
d.mu.Unlock()
|
||||
if cnt > 0 {
|
||||
avgAccessDepthInBlock.Mark(sum / cnt)
|
||||
minAccessDepthInBlock.Mark(min)
|
||||
avgAccessDepthInBlock.Update(sum / cnt)
|
||||
minAccessDepthInBlock.Update(min)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue