mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
core/rawdb: replace preimage hits metric with miss
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
4038c59845
commit
3a6067c9e4
2 changed files with 3 additions and 3 deletions
|
|
@ -27,6 +27,7 @@ import (
|
||||||
// ReadPreimage retrieves a single preimage of the provided hash.
|
// ReadPreimage retrieves a single preimage of the provided hash.
|
||||||
func ReadPreimage(db ethdb.KeyValueReader, hash common.Hash) []byte {
|
func ReadPreimage(db ethdb.KeyValueReader, hash common.Hash) []byte {
|
||||||
data, _ := db.Get(preimageKey(hash))
|
data, _ := db.Get(preimageKey(hash))
|
||||||
|
preimageMissCounter.Inc(1)
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +39,6 @@ func WritePreimages(db ethdb.KeyValueWriter, preimages map[common.Hash][]byte) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
preimageCounter.Inc(int64(len(preimages)))
|
preimageCounter.Inc(int64(len(preimages)))
|
||||||
preimageHitCounter.Inc(int64(len(preimages)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadCode retrieves the contract code of the provided code hash.
|
// ReadCode retrieves the contract code of the provided code hash.
|
||||||
|
|
|
||||||
|
|
@ -145,8 +145,8 @@ var (
|
||||||
FixedCommitteeRootKey = []byte("fixedRoot-") // bigEndian64(syncPeriod) -> committee root hash
|
FixedCommitteeRootKey = []byte("fixedRoot-") // bigEndian64(syncPeriod) -> committee root hash
|
||||||
SyncCommitteeKey = []byte("committee-") // bigEndian64(syncPeriod) -> serialized committee
|
SyncCommitteeKey = []byte("committee-") // bigEndian64(syncPeriod) -> serialized committee
|
||||||
|
|
||||||
preimageCounter = metrics.NewRegisteredCounter("db/preimage/total", nil)
|
preimageCounter = metrics.NewRegisteredCounter("db/preimage/total", nil)
|
||||||
preimageHitCounter = metrics.NewRegisteredCounter("db/preimage/hits", nil)
|
preimageMissCounter = metrics.NewRegisteredCounter("db/preimage/miss", nil)
|
||||||
)
|
)
|
||||||
|
|
||||||
// LegacyTxLookupEntry is the legacy TxLookupEntry definition with some unnecessary
|
// LegacyTxLookupEntry is the legacy TxLookupEntry definition with some unnecessary
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue