metrics

package
v0.0.0-...-271e206 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMeter

func InitMeter(p Meter)

InitMeter Init the metric provider. Must call before GetMeter.

Types

type Meter

type Meter interface {
	NewMetric(name string, types []MetricType, tagNames []string) (Metric, error)
}

func GetMeter

func GetMeter() Meter

GetMeter Get the metric provider. Must call InitMeter first.

type Metric

type Metric interface {
	Emit(tags []T, values ...*Value)
}

type MetricType

type MetricType string
const (
	MetricTypeCounter     MetricType = "counter"
	MetricTypeRateCounter MetricType = "rate_counter"
	MetricTypeStore       MetricType = "store"
	MetricTypeTimer       MetricType = "timer"
	MetricTypeHistogram   MetricType = "histogram"
)

type T

type T struct {
	Name  string
	Value string
}

type Value

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

func Counter

func Counter(n int64, opts ...ValueOption) *Value

func CounterF

func CounterF(n float64, opts ...ValueOption) *Value

func Histogram

func Histogram(n int64, opts ...ValueOption) *Value

func HistogramF

func HistogramF(n float64, opts ...ValueOption) *Value

func RateCounter

func RateCounter(n int64, opts ...ValueOption) *Value

func RateCounterF

func RateCounterF(n float64, opts ...ValueOption) *Value

func Store

func Store(n int64, opts ...ValueOption) *Value

func StoreF

func StoreF(n float64, opts ...ValueOption) *Value

func Timer

func Timer(n int64, opts ...ValueOption) *Value

func TimerF

func TimerF(n float64, opts ...ValueOption) *Value

func (*Value) GetSuffix

func (v *Value) GetSuffix() string

func (*Value) GetType

func (v *Value) GetType() MetricType

func (*Value) GetValue

func (v *Value) GetValue() *int64

func (*Value) GetValueF

func (v *Value) GetValueF() *float64

type ValueOption

type ValueOption func(v *Value)

func WithSuffix

func WithSuffix(suffix string) ValueOption

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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