diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-23 23:36:08 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-24 23:34:05 +0800 |
commit | 803b3c4a825ed0ac5d22c93fc3159651b8c590b2 (patch) | |
tree | 1c36d4edcf7f341dfbc177b45ed2b8df2cb0a7e9 /eth | |
parent | 0609fcf030f5e93528501e6fea98e096feccec3c (diff) | |
download | dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.tar dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.tar.gz dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.tar.bz2 dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.tar.lz dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.tar.xz dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.tar.zst dexon-803b3c4a825ed0ac5d22c93fc3159651b8c590b2.zip |
eth, ethdb: measure database operation latencies too
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/eth/backend.go b/eth/backend.go index cef0fe3ab..0da6f128c 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -250,9 +250,9 @@ func New(config *Config) (*Ethereum, error) { return nil, fmt.Errorf("blockchain db err: %v", err) } if db, ok := blockDb.(*ethdb.LDBDatabase); ok { - db.GetMeter = metrics.GetOrRegisterMeter("eth/db/block/Gets", metrics.DefaultRegistry) - db.PutMeter = metrics.GetOrRegisterMeter("eth/db/block/Puts", metrics.DefaultRegistry) - db.DelMeter = metrics.GetOrRegisterMeter("eth/db/block/Dels", metrics.DefaultRegistry) + db.GetTimer = metrics.GetOrRegisterTimer("eth/db/block/Gets", metrics.DefaultRegistry) + db.PutTimer = metrics.GetOrRegisterTimer("eth/db/block/Puts", metrics.DefaultRegistry) + db.MissMeter = metrics.GetOrRegisterMeter("eth/db/block/Misses", metrics.DefaultRegistry) db.ReadMeter = metrics.GetOrRegisterMeter("eth/db/block/Reads", metrics.DefaultRegistry) db.WriteMeter = metrics.GetOrRegisterMeter("eth/db/block/Writes", metrics.DefaultRegistry) } @@ -261,9 +261,9 @@ func New(config *Config) (*Ethereum, error) { return nil, fmt.Errorf("state db err: %v", err) } if db, ok := stateDb.(*ethdb.LDBDatabase); ok { - db.GetMeter = metrics.GetOrRegisterMeter("eth/db/state/Gets", metrics.DefaultRegistry) - db.PutMeter = metrics.GetOrRegisterMeter("eth/db/state/Puts", metrics.DefaultRegistry) - db.DelMeter = metrics.GetOrRegisterMeter("eth/db/state/Dels", metrics.DefaultRegistry) + db.GetTimer = metrics.GetOrRegisterTimer("eth/db/state/Gets", metrics.DefaultRegistry) + db.PutTimer = metrics.GetOrRegisterTimer("eth/db/state/Puts", metrics.DefaultRegistry) + db.MissMeter = metrics.GetOrRegisterMeter("eth/db/state/Misses", metrics.DefaultRegistry) db.ReadMeter = metrics.GetOrRegisterMeter("eth/db/state/Reads", metrics.DefaultRegistry) db.WriteMeter = metrics.GetOrRegisterMeter("eth/db/state/Writes", metrics.DefaultRegistry) } @@ -272,9 +272,9 @@ func New(config *Config) (*Ethereum, error) { return nil, fmt.Errorf("extra db err: %v", err) } if db, ok := extraDb.(*ethdb.LDBDatabase); ok { - db.GetMeter = metrics.GetOrRegisterMeter("eth/db/extra/Gets", metrics.DefaultRegistry) - db.PutMeter = metrics.GetOrRegisterMeter("eth/db/extra/Puts", metrics.DefaultRegistry) - db.DelMeter = metrics.GetOrRegisterMeter("eth/db/extra/Dels", metrics.DefaultRegistry) + db.GetTimer = metrics.GetOrRegisterTimer("eth/db/extra/Gets", metrics.DefaultRegistry) + db.PutTimer = metrics.GetOrRegisterTimer("eth/db/extra/Puts", metrics.DefaultRegistry) + db.MissMeter = metrics.GetOrRegisterMeter("eth/db/extra/Misses", metrics.DefaultRegistry) db.ReadMeter = metrics.GetOrRegisterMeter("eth/db/extra/Reads", metrics.DefaultRegistry) db.WriteMeter = metrics.GetOrRegisterMeter("eth/db/extra/Writes", metrics.DefaultRegistry) } |