mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-17 15:11:21 +00:00
add rounds metric
This commit is contained in:
@ -7,6 +7,7 @@ import "github.com/go-kit/kit/metrics/discard"
|
|||||||
// see MetricsProvider for descriptions.
|
// see MetricsProvider for descriptions.
|
||||||
type Metrics struct {
|
type Metrics struct {
|
||||||
Height metrics.Counter
|
Height metrics.Counter
|
||||||
|
Rounds metrics.Gauge
|
||||||
|
|
||||||
Validators metrics.Gauge
|
Validators metrics.Gauge
|
||||||
ValidatorsPower metrics.Gauge
|
ValidatorsPower metrics.Gauge
|
||||||
|
@ -697,6 +697,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.Info(cmn.Fmt("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step))
|
logger.Info(cmn.Fmt("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step))
|
||||||
|
cs.metrics.Rounds.Set(float64(round))
|
||||||
|
|
||||||
// Increment validators if necessary
|
// Increment validators if necessary
|
||||||
validators := cs.Validators
|
validators := cs.Validators
|
||||||
|
@ -102,6 +102,11 @@ func DefaultMetricsProvider() *cs.Metrics {
|
|||||||
Name: "height",
|
Name: "height",
|
||||||
Help: "Height of the chain.",
|
Help: "Height of the chain.",
|
||||||
}, []string{}),
|
}, []string{}),
|
||||||
|
Rounds: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
||||||
|
Subsystem: "consensus",
|
||||||
|
Name: "rounds",
|
||||||
|
Help: "Number of rounds.",
|
||||||
|
}, []string{}),
|
||||||
|
|
||||||
Validators: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
Validators: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
||||||
Subsystem: "consensus",
|
Subsystem: "consensus",
|
||||||
|
Reference in New Issue
Block a user