aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb
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 /ethdb
parent7841f0cc09885dce408e2a32bab36b833ea896b6 (diff)
downloadgo-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar
go-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.gz
go-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.bz2
go-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.lz
go-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.xz
go-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.tar.zst
go-tangerine-f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2.zip
ethdb: fully disable metrics if not requested (oops?)
Diffstat (limited to 'ethdb')
-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")