From f1ddb1a7adcf2ba46fa680ee0072a1df85a9bea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 23 Feb 2016 15:47:04 +0200 Subject: [PATCH] ethdb: fully disable metrics if not requested (oops?) --- ethdb/database.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ethdb/database.go b/ethdb/database.go index 047821c303..10dc018b0f 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")