metrics

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseGet = NewCounter("database_get_total", "Total database get operations", []string{})
View Source
var DatabaseGetKeysPrefix = NewCounter("database_get_prefix_total", "Total database set operations", []string{})
View Source
var DatabasePropose = NewCounter("database_propose_total", "Total database set operations", []string{})
View Source
var DatabaseRemove = NewCounter("database_remove_total", "Total database set operations", []string{})
View Source
var DatabaseSet = NewCounter("database_set_total", "Total database set operations", []string{})

Functions

This section is empty.

Types

type Counter

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

func NewCounter

func NewCounter(name string, help string, labels []string) *Counter

func (*Counter) Increment

func (c *Counter) Increment(labels ...string)

func (*Counter) Register

func (c *Counter) Register()

type Gauge

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

func NewGauge

func NewGauge(name string, help string, labels []string) *Gauge

func (*Gauge) Register

func (g *Gauge) Register()

func (*Gauge) Set

func (g *Gauge) Set(value float64, labels ...string)

type Histogram

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

func NewHistogram

func NewHistogram(name string, help string, labels []string) *Histogram

func (*Histogram) Observe

func (h *Histogram) Observe(value float64, labels ...string)

func (*Histogram) Register

func (h *Histogram) Register()

type Metric

type Metric interface {
	Register()
}

Metric is an interface that all Prometheus metrics must implement.

type MetricType

type MetricType string

MetricType is an enum-like type to represent different types of metrics.

const (
	CounterType   MetricType = "counter"
	GaugeType     MetricType = "gauge"
	HistogramType MetricType = "histogram"
)

Jump to

Keyboard shortcuts

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