Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/node/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ func newMetrics() nodeMetrics {
Subsystem: subsystem,
Name: "warmup_duration_seconds",
Help: "Duration in seconds for node warmup to complete",
// middle range should be more infrequent (because of addressbook)
Buckets: []float64{10, 20, 25, 30, 35, 40, 45, 50, 60, 70, 90, 120, 180, 240, 300, 350, 380, 400, 420, 440, 460, 480, 550, 600},
},
),
FullSyncDuration: prometheus.NewHistogram(
prometheus.HistogramOpts{
Namespace: metrics.Namespace,
Subsystem: subsystem,
Name: "full_sync_duration_seconds",
Help: "Duration in seconds for node warmup to complete",
Name: "full_sync_duration_minutes",
Help: "Duration in minutes for node full sync to complete",
// middle range should be more frequent
Buckets: []float64{80, 90, 100, 110,
120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, // 2-3 hours range
190, 200, 210, 220, 230, 240},
},
),
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ func NewBee(
"totalMonitoredEvents", totalCount,
"warmupDurationSeconds", warmupDuration)

// Record the warmup duration in the prometheus metric
nodeMetrics.WarmupDuration.Observe(warmupDuration)
pullSyncStartTime = t
}
Expand Down Expand Up @@ -1167,10 +1166,11 @@ func NewBee(
return
case <-syncCheckTicker.C:
synced := isFullySynced()
logger.Debug("sync status check", "synced", synced, "reserveSize", localStore.ReserveSize(), "threshold", reserveTreshold, "syncRate", pullerService.SyncRate())
logger.Debug("sync status check", "synced", synced, "reserveSize", localStore.ReserveSize(), "syncRate", pullerService.SyncRate())
if synced {
fullSyncTime := pullSyncStartTime.Sub(t)
nodeMetrics.FullSyncDuration.Observe(fullSyncTime.Seconds())
logger.Info("full sync duration", "duration", fullSyncTime)
nodeMetrics.FullSyncDuration.Observe(fullSyncTime.Minutes())
syncCheckTicker.Stop()
return
}
Expand Down
Loading