change consensus_block_interval_seconds metric type to gauge
Otherwise, it's impossible to see outliers https://github.com/tendermint/tendermint/issues/1835#issuecomment-402054099
This commit is contained in:
parent
484194789f
commit
788474d08d
|
@ -21,5 +21,6 @@ FEATURES:
|
||||||
|
|
||||||
IMPROVEMENTS:
|
IMPROVEMENTS:
|
||||||
- [types] add Address to GenesisValidator [\#1714](https://github.com/tendermint/tendermint/issues/1714)
|
- [types] add Address to GenesisValidator [\#1714](https://github.com/tendermint/tendermint/issues/1714)
|
||||||
|
- [metrics] `consensus.block_interval_metrics` is now gauge, not histogram (you will be able to see spikes, if any)
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
|
@ -30,7 +30,7 @@ type Metrics struct {
|
||||||
ByzantineValidatorsPower metrics.Gauge
|
ByzantineValidatorsPower metrics.Gauge
|
||||||
|
|
||||||
// Time between this and the last block.
|
// Time between this and the last block.
|
||||||
BlockIntervalSeconds metrics.Histogram
|
BlockIntervalSeconds metrics.Gauge
|
||||||
|
|
||||||
// Number of transactions.
|
// Number of transactions.
|
||||||
NumTxs metrics.Gauge
|
NumTxs metrics.Gauge
|
||||||
|
@ -85,11 +85,11 @@ func PrometheusMetrics() *Metrics {
|
||||||
Help: "Total power of the byzantine validators.",
|
Help: "Total power of the byzantine validators.",
|
||||||
}, []string{}),
|
}, []string{}),
|
||||||
|
|
||||||
BlockIntervalSeconds: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
|
|
||||||
|
BlockIntervalSeconds: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
||||||
Subsystem: "consensus",
|
Subsystem: "consensus",
|
||||||
Name: "block_interval_seconds",
|
Name: "block_interval_seconds",
|
||||||
Help: "Time between this and the last block.",
|
Help: "Time between this and the last block.",
|
||||||
Buckets: []float64{1, 2.5, 5, 10, 60},
|
|
||||||
}, []string{}),
|
}, []string{}),
|
||||||
|
|
||||||
NumTxs: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
NumTxs: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
||||||
|
@ -124,7 +124,7 @@ func NopMetrics() *Metrics {
|
||||||
ByzantineValidators: discard.NewGauge(),
|
ByzantineValidators: discard.NewGauge(),
|
||||||
ByzantineValidatorsPower: discard.NewGauge(),
|
ByzantineValidatorsPower: discard.NewGauge(),
|
||||||
|
|
||||||
BlockIntervalSeconds: discard.NewHistogram(),
|
BlockIntervalSeconds: discard.NewGauge(),
|
||||||
|
|
||||||
NumTxs: discard.NewGauge(),
|
NumTxs: discard.NewGauge(),
|
||||||
BlockSizeBytes: discard.NewGauge(),
|
BlockSizeBytes: discard.NewGauge(),
|
||||||
|
|
|
@ -1374,7 +1374,7 @@ func (cs *ConsensusState) recordMetrics(height int64, block *types.Block) {
|
||||||
|
|
||||||
if height > 1 {
|
if height > 1 {
|
||||||
lastBlockMeta := cs.blockStore.LoadBlockMeta(height - 1)
|
lastBlockMeta := cs.blockStore.LoadBlockMeta(height - 1)
|
||||||
cs.metrics.BlockIntervalSeconds.Observe(
|
cs.metrics.BlockIntervalSeconds.Set(
|
||||||
block.Time.Sub(lastBlockMeta.Header.Time).Seconds(),
|
block.Time.Sub(lastBlockMeta.Header.Time).Seconds(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue