less metrics performance impact

This commit is contained in:
alex.sharov 2021-03-08 18:58:44 +07:00
parent cdc090ebfd
commit 5ae602e9a4
2 changed files with 3 additions and 8 deletions

View File

@ -30,11 +30,6 @@ import (
"github.com/ledgerwatch/turbo-geth/common/dbutils" "github.com/ledgerwatch/turbo-geth/common/dbutils"
"github.com/ledgerwatch/turbo-geth/common/debug" "github.com/ledgerwatch/turbo-geth/common/debug"
"github.com/ledgerwatch/turbo-geth/log" "github.com/ledgerwatch/turbo-geth/log"
"github.com/ledgerwatch/turbo-geth/metrics"
)
var (
dbGetTimer = metrics.NewRegisteredTimer("db/get", nil)
) )
type DbCopier interface { type DbCopier interface {

View File

@ -113,9 +113,9 @@ func (m *TxDb) Last(bucket string) ([]byte, []byte, error) {
} }
func (m *TxDb) Get(bucket string, key []byte) ([]byte, error) { func (m *TxDb) Get(bucket string, key []byte) ([]byte, error) {
if metrics.Enabled { //if metrics.Enabled {
defer dbGetTimer.UpdateSince(time.Now()) // defer dbGetTimer.UpdateSince(time.Now())
} //}
_, v, err := m.cursor(bucket).SeekExact(key) _, v, err := m.cursor(bucket).SeekExact(key)
if err != nil { if err != nil {