imetrics

package
v1.202405300917.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 7 Imported by: 0

README

codecov

core-imetrics

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToPrometheus

func ToPrometheus(metric IMetric, metricValue float64) []byte

Types

type IMetric

type IMetric interface {
	Name() string

	Vvm() string

	// App returns istructs.NullAppQName when not specified
	App() istructs.AppQName
}

type IMetrics

type IMetrics interface {
	// Increase metric value with "delta".
	// The default metric value is always 0.
	// Naming best practices: https://prometheus.io/docs/practices/naming/
	//
	// @ConcurrentAccess
	Increase(metricName string, vvmName string, valueDelta float64)

	// Increase app metric value with "delta".
	// The default metric value is always 0.
	// Naming best practices: https://prometheus.io/docs/practices/naming/
	//
	// @ConcurrentAccess
	IncreaseApp(metricName string, vvmName string, app istructs.AppQName, valueDelta float64)

	// Returns address of metric value.
	// Only use atomic operations with that address!
	//
	// @ConcurrentAccess
	MetricAddr(metricName string, vvmName string) *MetricValue

	// Returns address of metric value.
	// Only use atomic operations with that address!
	//
	// @ConcurrentAccess
	AppMetricAddr(metricName string, vvmName string, app istructs.AppQName) *MetricValue

	// GetAll lists current values of all metrics
	//
	// @ConcurrentAccess
	List(cb func(metric IMetric, metricValue float64) (err error)) (err error)
}

func Provide

func Provide() IMetrics

Provide s.e.

type MetricValue

type MetricValue float64

func (*MetricValue) Increase

func (m *MetricValue) Increase(delta float64)

type MetricsFactory

type MetricsFactory func() IMetrics

Jump to

Keyboard shortcuts

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