metrics

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: AGPL-3.0-or-later Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentIdx

func CurrentIdx() (out float64)

func Deinit

func Deinit()

func DeinitEpochMetrics

func DeinitEpochMetrics()

func Init

func Init(namespace string) (http.Handler, error)

Init intializes the metrics package with the given namespace string. This should only be called once per process.

func InitEpochMetrics

func InitEpochMetrics()

func ObserveSoloValidator

func ObserveSoloValidator(node common.Address, pubkey rptypes.ValidatorPubkey)

func ObserveValidator

func ObserveValidator(node common.Address, pubkey rptypes.ValidatorPubkey)

func OnHead

func OnHead(epoch uint64)

func PreviousEpochNodes

func PreviousEpochNodes() (out float64)

func PreviousEpochSoloNodes

func PreviousEpochSoloNodes() (out float64)

func PreviousEpochSoloValidators

func PreviousEpochSoloValidators() (out float64)

func PreviousEpochValidators

func PreviousEpochValidators() (out float64)

func PreviousIdx

func PreviousIdx() (out float64)

Types

type Metrics

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

Metrics is a package-level singleton to track the state of all metrics generated by the process

type MetricsMap

type MetricsMap[M registerable, O any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type MetricsRegistry

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

MetricsRegistry proves a per-module api for creating and updating metrics

func NewMetricsRegistry

func NewMetricsRegistry(subsystem string) *MetricsRegistry

NewMetricsRegistry creates a new MetricsRegistry for a given module to use.

func (*MetricsRegistry) Counter

func (m *MetricsRegistry) Counter(name string) prometheus.Counter

Counter creates or fetches a prometheus Counter from the metrics registry and returns it.

func (*MetricsRegistry) Gauge

func (m *MetricsRegistry) Gauge(name string) prometheus.Gauge

Gauge creates or fetches a prometheus Gauge from the metrics registry and returns it.

func (*MetricsRegistry) GaugeFunc

func (m *MetricsRegistry) GaugeFunc(name string, handler func() float64)

func (*MetricsRegistry) Histogram

func (m *MetricsRegistry) Histogram(name string) prometheus.Histogram

Histogram creates or fetches a prometheus Histogram from the metrics registry and returns it.

func (*MetricsRegistry) UnregisterAll

func (r *MetricsRegistry) UnregisterAll()

Jump to

Keyboard shortcuts

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