metrics

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Namespace = "op_conductor"

Variables

This section is empty.

Functions

This section is empty.

Types

type Metricer

type Metricer interface {
	RecordInfo(version string)
	RecordUp()
	RecordStateChange(leader bool, healthy bool, active bool)
	RecordLeaderTransfer(success bool)
	RecordStartSequencer(success bool)
	RecordStopSequencer(success bool)
	RecordHealthCheck(success bool, err error)
	RecordLoopExecutionTime(duration float64)
}
var NoopMetrics Metricer = new(NoopMetricsImpl)

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) RecordHealthCheck

func (m *Metrics) RecordHealthCheck(success bool, err error)

RecordHealthCheck increments the healthChecks counter.

func (*Metrics) RecordInfo

func (m *Metrics) RecordInfo(version string)

RecordInfo sets a pseudo-metric that contains versioning and config info for the op-proposer.

func (*Metrics) RecordLeaderTransfer

func (m *Metrics) RecordLeaderTransfer(success bool)

RecordLeaderTransfer increments the leaderTransfers counter.

func (*Metrics) RecordLoopExecutionTime

func (m *Metrics) RecordLoopExecutionTime(duration float64)

RecordLoopExecutionTime records the time it took to execute the conductor loop.

func (*Metrics) RecordStartSequencer

func (m *Metrics) RecordStartSequencer(success bool)

RecordStartSequencer increments the sequencerStarts counter.

func (*Metrics) RecordStateChange

func (m *Metrics) RecordStateChange(leader bool, healthy bool, active bool)

RecordStateChange increments the stateChanges counter.

func (*Metrics) RecordStopSequencer

func (m *Metrics) RecordStopSequencer(success bool)

RecordStopSequencer increments the sequencerStops counter.

func (*Metrics) RecordUp

func (m *Metrics) RecordUp()

RecordUp sets the up metric to 1.

func (*Metrics) Registry

func (m *Metrics) Registry() *prometheus.Registry

func (*Metrics) Start

func (m *Metrics) Start(host string, port int) (*httputil.HTTPServer, error)

type NoopMetricsImpl

type NoopMetricsImpl struct{}

func (*NoopMetricsImpl) RecordHealthCheck

func (*NoopMetricsImpl) RecordHealthCheck(success bool, err error)

func (*NoopMetricsImpl) RecordInfo

func (*NoopMetricsImpl) RecordInfo(version string)

func (*NoopMetricsImpl) RecordLeaderTransfer

func (*NoopMetricsImpl) RecordLeaderTransfer(success bool)

func (*NoopMetricsImpl) RecordLoopExecutionTime

func (*NoopMetricsImpl) RecordLoopExecutionTime(duration float64)

func (*NoopMetricsImpl) RecordStartSequencer

func (*NoopMetricsImpl) RecordStartSequencer(success bool)

func (*NoopMetricsImpl) RecordStateChange

func (*NoopMetricsImpl) RecordStateChange(leader bool, healthy bool, active bool)

func (*NoopMetricsImpl) RecordStopSequencer

func (*NoopMetricsImpl) RecordStopSequencer(success bool)

func (*NoopMetricsImpl) RecordUp

func (*NoopMetricsImpl) RecordUp()

Jump to

Keyboard shortcuts

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