From 2ba422430b0b5e365c53d6238dbec103d5a07035 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Thu, 24 Jul 2025 09:49:24 +0800 Subject: [PATCH] eth/protocols/snap: change metric type --- eth/protocols/snap/metrics.go | 4 ++-- eth/protocols/snap/sync.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/protocols/snap/metrics.go b/eth/protocols/snap/metrics.go index 7ef0e33536..6319a9b75d 100644 --- a/eth/protocols/snap/metrics.go +++ b/eth/protocols/snap/metrics.go @@ -67,6 +67,6 @@ var ( largeStorageDiscardGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/chunk/discard", nil) 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) + stateSyncTimeGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/time/statesync", nil) + stateHealTimeGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/time/stateheal", nil) ) diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 1ef4e00fbc..cf4e494645 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -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{} }