mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +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 (
|
var (
|
||||||
avgAccessDepthInBlock = metrics.NewRegisteredMeter("trie/access/depth/avg", nil)
|
avgAccessDepthInBlock = metrics.NewRegisteredGauge("trie/access/depth/avg", nil)
|
||||||
minAccessDepthInBlock = metrics.NewRegisteredMeter("trie/access/depth/min", nil)
|
minAccessDepthInBlock = metrics.NewRegisteredGauge("trie/access/depth/min", nil)
|
||||||
stateDepthAggregator = &depthAggregator{}
|
stateDepthAggregator = &depthAggregator{}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -44,8 +44,8 @@ func (d *depthAggregator) end() {
|
||||||
sum, cnt, min := d.sum, d.cnt, d.min
|
sum, cnt, min := d.sum, d.cnt, d.min
|
||||||
d.mu.Unlock()
|
d.mu.Unlock()
|
||||||
if cnt > 0 {
|
if cnt > 0 {
|
||||||
avgAccessDepthInBlock.Mark(sum / cnt)
|
avgAccessDepthInBlock.Update(sum / cnt)
|
||||||
minAccessDepthInBlock.Mark(min)
|
minAccessDepthInBlock.Update(min)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue