restrict metric by 1 bucket (#1052)

This commit is contained in:
Alex Sharov 2020-09-05 13:09:47 +07:00 committed by GitHub
parent 279f59f950
commit 7e71c4512e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,9 @@ func (m *TxDb) Begin() (DbWithPendingMutations, error) {
func (m *TxDb) Put(bucket string, key []byte, value []byte) error {
if metrics.Enabled {
defer dbPutTimer.UpdateSince(time.Now())
if bucket == dbutils.PlainStateBucket {
defer dbPutTimer.UpdateSince(time.Now())
}
}
m.len += uint64(len(key) + len(value))
return m.cursors[bucket].Put(key, value)