Skip to content

Commit 0cfadf5

Browse files
committed
rename
Signed-off-by: jsvisa <delweng@gmail.com>
1 parent 410f569 commit 0cfadf5

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

ethdb/pebble/pebble.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ type Database struct {
8585
liveCompGauge *metrics.Gauge // Gauge for tracking the number of in-progress compactions
8686
liveCompSizeGauge *metrics.Gauge // Gauge for tracking the size of in-progress compactions
8787
levelsGauge []*metrics.Gauge // Gauge for tracking the number of tables in levels
88-
readExistedCount *metrics.Counter // Counter for tracking the number of existed keys readed
89-
readNotfoundCount *metrics.Counter // Counter for tracking the number of notfound keys readed
88+
readExistCount *metrics.Counter // Counter for tracking the number of existed keys readed
89+
readInexCount *metrics.Counter // Counter for tracking the number of notfound keys readed
9090
writeCount *metrics.Counter // Counter for tracking the number of written
91-
readExistedTime *metrics.ResettingTimer // Timer for tracking the time spent on reading existed keys
92-
readNotfoundTime *metrics.ResettingTimer // Timer for tracking the time spent on reading notfound keys
91+
readExistTime *metrics.ResettingTimer // Timer for tracking the time spent on reading existed keys
92+
readInexTime *metrics.ResettingTimer // Timer for tracking the time spent on reading notfound keys
9393
writeTime *metrics.ResettingTimer // Timer for tracking the time spent on writing
9494

9595
quitLock sync.RWMutex // Mutex protecting the quit channel and the closed flag
@@ -332,11 +332,11 @@ func (d *Database) Has(key []byte) (bool, error) {
332332
st := time.Now()
333333
_, closer, err := d.db.Get(key)
334334
if err == nil {
335-
d.readExistedTime.Update(time.Since(st))
336-
d.readExistedCount.Inc(1)
335+
d.readExistTime.Update(time.Since(st))
336+
d.readExistCount.Inc(1)
337337
} else if err == pebble.ErrNotFound {
338-
d.readNotfoundTime.Update(time.Since(st))
339-
d.readNotfoundCount.Inc(1)
338+
d.readInexTime.Update(time.Since(st))
339+
d.readInexCount.Inc(1)
340340
}
341341

342342
if err == pebble.ErrNotFound {
@@ -361,11 +361,11 @@ func (d *Database) Get(key []byte) ([]byte, error) {
361361
st := time.Now()
362362
dat, closer, err := d.db.Get(key)
363363
if err == nil {
364-
d.readExistedTime.Update(time.Since(st))
365-
d.readExistedCount.Inc(1)
364+
d.readExistTime.Update(time.Since(st))
365+
d.readExistCount.Inc(1)
366366
} else if err == pebble.ErrNotFound {
367-
d.readNotfoundTime.Update(time.Since(st))
368-
d.readNotfoundCount.Inc(1)
367+
d.readInexTime.Update(time.Since(st))
368+
d.readInexCount.Inc(1)
369369
}
370370

371371
if err != nil {
@@ -517,11 +517,11 @@ func (d *Database) registerMetrics(namespace string) {
517517
d.estimatedCompDebtGauge = metrics.GetOrRegisterGauge(namespace+"compact/estimateDebt", nil)
518518
d.liveCompGauge = metrics.GetOrRegisterGauge(namespace+"compact/live/count", nil)
519519
d.liveCompSizeGauge = metrics.GetOrRegisterGauge(namespace+"compact/live/size", nil)
520-
d.readExistedCount = metrics.GetOrRegisterCounter(namespace+"read/existed/count", nil)
521-
d.readNotfoundCount = metrics.GetOrRegisterCounter(namespace+"read/notfound/count", nil)
520+
d.readExistCount = metrics.GetOrRegisterCounter(namespace+"read/exist/count", nil)
521+
d.readInexCount = metrics.GetOrRegisterCounter(namespace+"read/inex/count", nil)
522522
d.writeCount = metrics.GetOrRegisterCounter(namespace+"write/count", nil)
523-
d.readExistedTime = metrics.NewRegisteredResettingTimer(namespace+"read/existed/duration", nil)
524-
d.readNotfoundTime = metrics.NewRegisteredResettingTimer(namespace+"read/notfound/duration", nil)
523+
d.readExistTime = metrics.NewRegisteredResettingTimer(namespace+"read/exist/duration", nil)
524+
d.readInexTime = metrics.NewRegisteredResettingTimer(namespace+"read/inex/duration", nil)
525525
d.writeTime = metrics.NewRegisteredResettingTimer(namespace+"write/duration", nil)
526526
}
527527

0 commit comments

Comments
 (0)