eth/protocols/snap: change metric type

This commit is contained in:
Gary Rong 2025-07-24 09:49:24 +08:00
parent 468cf823bb
commit 2ba422430b
2 changed files with 3 additions and 3 deletions

View file

@ -68,5 +68,5 @@ var (
largeStorageResumedGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/chunk/resume", nil)
stateSyncTimeGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/time/statesync", nil)
stateHealTimeResettingTimer = metrics.NewRegisteredResettingTimer("eth/protocols/snap/sync/time/stateheal", nil)
stateHealTimeGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/time/stateheal", nil)
)

View file

@ -691,7 +691,7 @@ func (s *Syncer) Sync(root common.Hash, cancel chan struct{}) error {
// Note: healing may be rerun in subsequent cycles to fill gaps between
// pivot states (e.g., if chain sync takes longer).
if !s.healStartTime.IsZero() {
stateHealTimeResettingTimer.Update(time.Since(s.healStartTime))
stateHealTimeGauge.Inc(int64(time.Since(s.healStartTime)))
log.Info("State healing phase is completed", "elapsed", common.PrettyDuration(time.Since(s.healStartTime)))
s.healStartTime = time.Time{}
}