sebak: boscoin.io/sebak/lib/metrics Index | Files

package metrics

import "boscoin.io/sebak/lib/metrics"

Index

Package Files

api.go consensus.go constant.go prom.go sync.go txpool.go vars.go version.go

Constants

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

Variables

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

func InitPrometheusMetrics Uses

func InitPrometheusMetrics()

func PromVersion Uses

func PromVersion() metrics.Gauge

func SetVersion Uses

func SetVersion()

type APIMetrics Uses

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

func NopAPIMetrics Uses

func NopAPIMetrics() *APIMetrics

func PromAPIMetrics Uses

func PromAPIMetrics() *APIMetrics

type ConsensusMetrics Uses

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 Uses

func NopConsensusMetrics() *ConsensusMetrics

func PromConsensusMetrics Uses

func PromConsensusMetrics() *ConsensusMetrics

func (*ConsensusMetrics) SetBlockIntervalSeconds Uses

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

func (*ConsensusMetrics) SetHeight Uses

func (c *ConsensusMetrics) SetHeight(height uint64)

func (*ConsensusMetrics) SetMissingValidators Uses

func (c *ConsensusMetrics) SetMissingValidators(num int)

func (*ConsensusMetrics) SetRounds Uses

func (c *ConsensusMetrics) SetRounds(round uint64)

func (*ConsensusMetrics) SetTotalOps Uses

func (c *ConsensusMetrics) SetTotalOps(total uint64)

func (*ConsensusMetrics) SetTotalTxs Uses

func (c *ConsensusMetrics) SetTotalTxs(total uint64)

func (*ConsensusMetrics) SetValidators Uses

func (c *ConsensusMetrics) SetValidators(num int)

type SyncMetrics Uses

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

func NopSyncMetrics Uses

func NopSyncMetrics() *SyncMetrics

func PromSyncMetrics Uses

func PromSyncMetrics() *SyncMetrics

func (*SyncMetrics) AddFetchError Uses

func (s *SyncMetrics) AddFetchError()

func (*SyncMetrics) AddValidateError Uses

func (s *SyncMetrics) AddValidateError()

func (*SyncMetrics) ObserveDurationSeconds Uses

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

func (*SyncMetrics) SetHeight Uses

func (s *SyncMetrics) SetHeight(height uint64)

type TxPoolMetrics Uses

type TxPoolMetrics struct {
    Size metrics.Gauge
}

func NopTxPoolMetrics Uses

func NopTxPoolMetrics() *TxPoolMetrics

func PromTxPoolMetrics Uses

func PromTxPoolMetrics() *TxPoolMetrics

func (*TxPoolMetrics) AddSize Uses

func (m *TxPoolMetrics) AddSize(delta int)

Package metrics imports 7 packages (graph) and is imported by 13 packages. Updated 2019-03-27. Refresh now. Tools for package owners.