aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-02-24 18:50:45 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-24 18:50:45 +0800
commit1e62cd6c79afdc4b39a30932f950673405f0c702 (patch)
treef49b7efe466402119744488ee72694ba624a6153
parent7841f0cc09885dce408e2a32bab36b833ea896b6 (diff)
parentf1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2 (diff)
downloadgo-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.tar
go-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.tar.gz
go-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.tar.bz2
go-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.tar.lz
go-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.tar.xz
go-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.tar.zst
go-tangerine-1e62cd6c79afdc4b39a30932f950673405f0c702.zip
Merge pull request #2252 from karalabe/disable-metrics-metaops
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")