mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
61 lines
1.5 KiB
Go
61 lines
1.5 KiB
Go
package consensus
|
|
|
|
import (
|
|
"github.com/go-kit/kit/metrics"
|
|
"github.com/go-kit/kit/metrics/discard"
|
|
)
|
|
|
|
// Metrics contains metrics exposed by this package.
|
|
type Metrics struct {
|
|
// Height of the chain.
|
|
Height metrics.Gauge
|
|
|
|
// Number of rounds.
|
|
Rounds metrics.Gauge
|
|
|
|
// Number of validators.
|
|
Validators metrics.Gauge
|
|
// Total power of all validators.
|
|
ValidatorsPower metrics.Gauge
|
|
// Number of validators who did not sign.
|
|
MissingValidators metrics.Gauge
|
|
// Total power of the missing validators.
|
|
MissingValidatorsPower metrics.Gauge
|
|
// Number of validators who tried to double sign.
|
|
ByzantineValidators metrics.Gauge
|
|
// Total power of the byzantine validators.
|
|
ByzantineValidatorsPower metrics.Gauge
|
|
|
|
// Time between this and the last block.
|
|
BlockIntervalSeconds metrics.Histogram
|
|
|
|
// Number of transactions.
|
|
NumTxs metrics.Gauge
|
|
// Size of the block.
|
|
BlockSizeBytes metrics.Gauge
|
|
// Total number of transactions.
|
|
TotalTxs metrics.Gauge
|
|
}
|
|
|
|
// NopMetrics returns no-op Metrics.
|
|
func NopMetrics() *Metrics {
|
|
return &Metrics{
|
|
Height: discard.NewGauge(),
|
|
|
|
Rounds: discard.NewGauge(),
|
|
|
|
Validators: discard.NewGauge(),
|
|
ValidatorsPower: discard.NewGauge(),
|
|
MissingValidators: discard.NewGauge(),
|
|
MissingValidatorsPower: discard.NewGauge(),
|
|
ByzantineValidators: discard.NewGauge(),
|
|
ByzantineValidatorsPower: discard.NewGauge(),
|
|
|
|
BlockIntervalSeconds: discard.NewHistogram(),
|
|
|
|
NumTxs: discard.NewGauge(),
|
|
BlockSizeBytes: discard.NewGauge(),
|
|
TotalTxs: discard.NewGauge(),
|
|
}
|
|
}
|