metrics

package
v0.2.17-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package metrics defines telemetry primitives to be used across components. it uses the prometheus format.

Index

Constants

View Source
const (
	// Namespace is the basic namespace where all metrics are defined under.
	Namespace = "spacemesh"
)

Variables

This section is empty.

Functions

func NewCounter

func NewCounter(name, subsystem, help string, labels []string) *prometheus.CounterVec

NewCounter creates a Counter metrics under the global namespace returns nop if metrics are disabled.

func NewGauge

func NewGauge(name, subsystem, help string, labels []string) *prometheus.GaugeVec

NewGauge creates a Gauge metrics under the global namespace returns nop if metrics are disabled.

func NewHistogram

func NewHistogram(name, subsystem, help string, labels []string) *prometheus.HistogramVec

NewHistogram creates a Histogram metrics under the global namespace returns nop if metrics are disabled.

func NewHistogramWithBuckets added in v1.0.0

func NewHistogramWithBuckets(name, subsystem, help string, labels []string, buckets []float64) *prometheus.HistogramVec

NewHistogramWithBuckets creates a Histogram metrics with custom buckets.

func StartMetricsServer added in v1.0.0

func StartMetricsServer(metricsPort int)

StartMetricsServer begins listening and supplying metrics on localhost:`metricsPort`/metrics.

func StartPushingMetrics added in v1.0.0

func StartPushingMetrics(url string, periodSec int, nodeID, networkID string)

StartPushingMetrics begins pushing metrics to the url specified by the --metrics-push flag with period specified by the --metrics-push-period flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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