Skip to content

Commit f1ddb1a

Browse files
committed
ethdb: fully disable metrics if not requested (oops?)
1 parent 7841f0c commit f1ddb1a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎ethdb/database.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ func (self *LDBDatabase) LDB() *leveldb.DB {
168168

169169
// Meter configures the database metrics collectors and
170170
func (self *LDBDatabase) Meter(prefix string) {
171+
// Short circuit metering if the metrics system is disabled
172+
if !metrics.Enabled {
173+
return
174+
}
171175
// Initialize all the metrics collector at the requested prefix
172176
self.getTimer = metrics.NewTimer(prefix + "user/gets")
173177
self.putTimer = metrics.NewTimer(prefix + "user/puts")

0 commit comments

Comments
 (0)