diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-02-23 21:47:04 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-02-23 21:47:04 +0800 |
commit | f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2 (patch) | |
tree | f49b7efe466402119744488ee72694ba624a6153 /ethdb/database.go | |
parent | 7841f0cc09885dce408e2a32bab36b833ea896b6 (diff) | |
download | dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.gz dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.zst dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.zip |
ethdb: fully disable metrics if not requested (oops?)
Diffstat (limited to 'ethdb/database.go')
-rw-r--r-- | ethdb/database.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ethdb/database.go b/ethdb/database.go index 047821c30..10dc018b0 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -168,6 +168,10 @@ func (self *LDBDatabase) LDB() *leveldb.DB { // Meter configures the database metrics collectors and 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 self.getTimer = metrics.NewTimer(prefix + "user/gets") self.putTimer = metrics.NewTimer(prefix + "user/puts") |