mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-03 14:52:55 +00:00
ethdb: fully disable metrics if not requested (oops?)
This commit is contained in:
parent
7841f0cc09
commit
f1ddb1a7ad
1 changed files with 4 additions and 0 deletions
|
|
@ -168,6 +168,10 @@ func (self *LDBDatabase) LDB() *leveldb.DB {
|
||||||
|
|
||||||
// Meter configures the database metrics collectors and
|
// Meter configures the database metrics collectors and
|
||||||
func (self *LDBDatabase) Meter(prefix string) {
|
func (self *LDBDatabase) Meter(prefix string) {
|
||||||
|
// Short circuit metering if the metrics system is disabled
|
||||||
|
if !metrics.Enabled {
|
||||||
|
return
|
||||||
|
}
|
||||||
// Initialize all the metrics collector at the requested prefix
|
// Initialize all the metrics collector at the requested prefix
|
||||||
self.getTimer = metrics.NewTimer(prefix + "user/gets")
|
self.getTimer = metrics.NewTimer(prefix + "user/gets")
|
||||||
self.putTimer = metrics.NewTimer(prefix + "user/puts")
|
self.putTimer = metrics.NewTimer(prefix + "user/puts")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue