metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsInterface

type MetricsInterface interface {
	RecordFromCodec(codec codec.CodecInterface)
}

MetricsInterface represents the metrics interface for all available providers

type Prometheus

type Prometheus struct {
	Service      string
	Collector    *prometheus.GaugeVec
	CodecChannel chan codec.CodecInterface
}

Prometheus represents the prometheus struct for collecting metrics

func NewPrometheus

func NewPrometheus(service string) *Prometheus

NewPrometheus initializes a new prometheus metric instance

func (*Prometheus) Record

func (m *Prometheus) Record(store, metric string, value float64)

Record records a metric in prometheus by specifying the store name, metric name and value

func (*Prometheus) RecordFromCodec

func (m *Prometheus) RecordFromCodec(codec codec.CodecInterface)

RecordFromCodec sends the given codec into the codec channel to be read from recorder

Jump to

Keyboard shortcuts

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