Skip to content

Commit

Permalink
services/horizon: Change horizon_ingest_state_verify_ledger_entries m…
Browse files Browse the repository at this point in the history
…etric to gauge (#4054)
  • Loading branch information
bartekn authored Nov 9, 2021
1 parent 30b2402 commit a216798
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions services/horizon/internal/ingest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ type Metrics struct {

// StateVerifyLedgerEntriesCount exposes total number of ledger entries
// checked by the state verifier by type.
StateVerifyLedgerEntriesCount *prometheus.SummaryVec
StateVerifyLedgerEntriesCount *prometheus.GaugeVec

// LedgerStatsCounter exposes ledger stats counters (like number of ops/changes).
LedgerStatsCounter *prometheus.CounterVec
Expand Down Expand Up @@ -323,12 +323,10 @@ func (s *system) initMetrics() {
},
)

s.metrics.StateVerifyLedgerEntriesCount = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "state_verify_ledger_entries_count",
s.metrics.StateVerifyLedgerEntriesCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "horizon", Subsystem: "ingest", Name: "state_verify_ledger_entries",
Help: "number of ledger entries downloaded from buckets in a single state verifier run",
// Quantile ranks are not relevant here so pass empty map.
Objectives: map[float64]float64{},
},
[]string{"type"},
)
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/ingest/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (s *system) verifyState(verifyAgainstLatestCheckpoint bool) error {
s.Metrics().StateVerifyDuration.Observe(float64(duration))
for typ, tot := range totalByType {
s.Metrics().StateVerifyLedgerEntriesCount.
With(prometheus.Labels{"type": typ}).Observe(float64(tot))
With(prometheus.Labels{"type": typ}).Set(float64(tot))
}
}
}
Expand Down

0 comments on commit a216798

Please sign in to comment.