2018-06-11 17:14:42 +04:00
|
|
|
package consensus
|
|
|
|
|
|
|
|
import "github.com/go-kit/kit/metrics"
|
|
|
|
import "github.com/go-kit/kit/metrics/discard"
|
|
|
|
|
|
|
|
// Metrics contains metrics exposed by this package.
|
|
|
|
type Metrics struct {
|
|
|
|
// height of the chain
|
|
|
|
Height metrics.Counter
|
2018-06-13 20:38:19 +04:00
|
|
|
// number of validators who signed
|
|
|
|
Validators metrics.Gauge
|
|
|
|
// number of validators who did not sign
|
|
|
|
MissingValidators metrics.Gauge
|
|
|
|
// number of validators who tried to double sign
|
|
|
|
ByzantineValidators metrics.Gauge
|
2018-06-15 14:23:34 +04:00
|
|
|
// time between this and the last block
|
|
|
|
BlockIntervalSeconds metrics.Histogram
|
2018-06-14 16:09:32 +04:00
|
|
|
// number of transactions
|
|
|
|
NumTxs metrics.Gauge
|
|
|
|
// total number of transactions
|
|
|
|
TotalTxs metrics.Counter
|
|
|
|
// size of the block
|
|
|
|
BlockSizeBytes metrics.Gauge
|
2018-06-11 17:14:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// NopMetrics returns no-op Metrics.
|
|
|
|
func NopMetrics() *Metrics {
|
|
|
|
return &Metrics{
|
2018-06-15 14:23:34 +04:00
|
|
|
Height: discard.NewCounter(),
|
|
|
|
Validators: discard.NewGauge(),
|
|
|
|
MissingValidators: discard.NewGauge(),
|
|
|
|
ByzantineValidators: discard.NewGauge(),
|
|
|
|
BlockIntervalSeconds: discard.NewHistogram(),
|
|
|
|
NumTxs: discard.NewGauge(),
|
|
|
|
TotalTxs: discard.NewCounter(),
|
|
|
|
BlockSizeBytes: discard.NewGauge(),
|
2018-06-11 17:14:42 +04:00
|
|
|
}
|
|
|
|
}
|