From d0f3c1b3170a8712d39f15eb1f699126d33360c8 Mon Sep 17 00:00:00 2001 From: Viacheslav Gonkivskyi Date: Wed, 10 Jan 2024 16:33:14 +0200 Subject: [PATCH] chore: change positioning in struct --- sync/metrics.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sync/metrics.go b/sync/metrics.go index dd7c6302..847af443 100644 --- a/sync/metrics.go +++ b/sync/metrics.go @@ -12,20 +12,19 @@ import ( var meter = otel.Meter("header/sync") type metrics struct { - syncReg metric.Registration - - totalSynced atomic.Int64 - totalSyncedInst metric.Int64ObservableGauge + syncReg metric.Registration + subjectiveHeadInst metric.Int64ObservableGauge + totalSyncedInst metric.Int64ObservableGauge + totalSynced atomic.Int64 syncLoopStarted metric.Int64Counter trustedPeersOutOfSync metric.Int64Counter laggingHeadersStart metric.Int64Counter - subjectiveHead atomic.Int64 - subjectiveHeadInst metric.Int64ObservableGauge - blockTime metric.Float64Histogram - headerReceived time.Time - prevHeader time.Time + subjectiveHead atomic.Int64 + blockTime metric.Float64Histogram + headerReceived time.Time + prevHeader time.Time headersThreshold time.Duration } @@ -33,7 +32,7 @@ type metrics struct { func newMetrics(headersThreshold time.Duration) (*metrics, error) { totalSynced, err := meter.Int64ObservableGauge( "hdr_total_synced_headers", -metric.WithDescription("total synced headers shows how many headers have been synced since runtime"), + metric.WithDescription("total synced headers shows how many headers have been synced"), ) if err != nil { return nil, err @@ -41,7 +40,7 @@ metric.WithDescription("total synced headers shows how many headers have been sy syncLoopStarted, err := meter.Int64Counter( "hdr_sync_loop_started", -metric.WithDescription("sync loop started records timestamp of a new sync job"), + metric.WithDescription("sync loop started shows that syncing is in progress"), ) if err != nil { return nil, err