Skip to content

Commit

Permalink
chore: add description
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Jan 10, 2024
1 parent dc9ba3d commit 8749c91
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions sync/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,36 @@ import (
var meter = otel.Meter("header/sync")

type metrics struct {
syncReg metric.Registration

totalSynced atomic.Int64
totalSyncedInst metric.Int64ObservableGauge

syncLoopStarted metric.Int64Counter
trustedPeersOutOfSync metric.Int64Counter
laggingHeadersStart metric.Int64Counter

subjectiveHead atomic.Int64
blockTime metric.Float64Histogram

headerReceived time.Time
prevHeader time.Time

subjectiveHead atomic.Int64
subjectiveHeadInst metric.Int64ObservableGauge

syncReg metric.Registration
blockTime metric.Float64Histogram
headerReceived time.Time
prevHeader time.Time

headersThreshold time.Duration
}

func newMetrics(headersThreshold time.Duration) (*metrics, error) {
totalSynced, err := meter.Int64ObservableGauge(
"hdr_total_synced_headers",
metric.WithDescription("total synced headers"),
metric.WithDescription("total synced headers shows how many headers have been synced"),
)
if err != nil {
return nil, err
}

syncLoopStarted, err := meter.Int64Counter(
"hdr_sync_loop_started",
metric.WithDescription("sync loop started"),
metric.WithDescription("sync loop started shows that syncing is in progress"),
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8749c91

Please sign in to comment.