metrics

package
v0.0.0-...-8aa4d74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2019 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Namespace          = "sebak"
	ConsensusSubsystem = "consensus"
	SyncSubsystem      = "sync"
	TxPoolSubsystem    = "txpool"
	APISubsystem       = "api"
)
View Source
const (
	SyncComponent = "component"
	SyncFetcher   = "fetcher"
	SyncValidator = "validator"
	SyncAll       = "all"
)

Variables

View Source
var (
	Version   = discard.NewGauge()
	Consensus = NopConsensusMetrics()
	Sync      = NopSyncMetrics()
	TxPool    = NopTxPoolMetrics()
	API       = NopAPIMetrics()
)

Functions

func InitPrometheusMetrics

func InitPrometheusMetrics()

func PromVersion

func PromVersion() metrics.Gauge

func SetVersion

func SetVersion()

Types

type APIMetrics

type APIMetrics struct {
	RequestsTotal          metrics.Counter
	RequestErrorsTotal     metrics.Counter
	RequestDurationSeconds metrics.Histogram
}

func NopAPIMetrics

func NopAPIMetrics() *APIMetrics

func PromAPIMetrics

func PromAPIMetrics() *APIMetrics

type ConsensusMetrics

type ConsensusMetrics struct {
	Height metrics.Gauge
	Rounds metrics.Gauge

	BlockIntervalSeconds metrics.Histogram

	TotalTxs metrics.Gauge
	TotalOps metrics.Gauge

	Validators        metrics.Gauge
	MissingValidators metrics.Gauge
}

func NopConsensusMetrics

func NopConsensusMetrics() *ConsensusMetrics

func PromConsensusMetrics

func PromConsensusMetrics() *ConsensusMetrics

func (*ConsensusMetrics) SetBlockIntervalSeconds

func (c *ConsensusMetrics) SetBlockIntervalSeconds(t time.Time) time.Time

func (*ConsensusMetrics) SetHeight

func (c *ConsensusMetrics) SetHeight(height uint64)

func (*ConsensusMetrics) SetMissingValidators

func (c *ConsensusMetrics) SetMissingValidators(num int)

func (*ConsensusMetrics) SetRounds

func (c *ConsensusMetrics) SetRounds(round uint64)

func (*ConsensusMetrics) SetTotalOps

func (c *ConsensusMetrics) SetTotalOps(total uint64)

func (*ConsensusMetrics) SetTotalTxs

func (c *ConsensusMetrics) SetTotalTxs(total uint64)

func (*ConsensusMetrics) SetValidators

func (c *ConsensusMetrics) SetValidators(num int)

type SyncMetrics

type SyncMetrics struct {
	Height          metrics.Gauge
	ErrorTotal      metrics.Counter
	DurationSeconds metrics.Histogram
}

func NopSyncMetrics

func NopSyncMetrics() *SyncMetrics

func PromSyncMetrics

func PromSyncMetrics() *SyncMetrics

func (*SyncMetrics) AddFetchError

func (s *SyncMetrics) AddFetchError()

func (*SyncMetrics) AddValidateError

func (s *SyncMetrics) AddValidateError()

func (*SyncMetrics) ObserveDurationSeconds

func (s *SyncMetrics) ObserveDurationSeconds(begin time.Time, component string)

func (*SyncMetrics) SetHeight

func (s *SyncMetrics) SetHeight(height uint64)

type TxPoolMetrics

type TxPoolMetrics struct {
	Size metrics.Gauge
}

func NopTxPoolMetrics

func NopTxPoolMetrics() *TxPoolMetrics

func PromTxPoolMetrics

func PromTxPoolMetrics() *TxPoolMetrics

func (*TxPoolMetrics) AddSize

func (m *TxPoolMetrics) AddSize(delta int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL