aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-02-23 21:47:04 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-23 21:47:04 +0800
commitf1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2 (patch)
treef49b7efe466402119744488ee72694ba624a6153
parent7841f0cc09885dce408e2a32bab36b833ea896b6 (diff)
downloaddexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar
dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.gz
dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.bz2
dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.lz
dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.xz
dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.zst
dexon-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.zip
ethdb: fully disable metrics if not requested (oops?)
-rw-r--r--ethdb/database.go4
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")