metrics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMetrics

func WriteMetrics(path string) error

Types

type Counter

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

func GetCounter

func GetCounter(name string, reuse bool, context ...string) *Counter

func (*Counter) Add

func (c *Counter) Add(value int) *Counter

func (*Counter) Inc

func (c *Counter) Inc() *Counter

func (*Counter) Result

func (c *Counter) Result() Result

type Metric

type Metric interface {
	Result() Result
}

type Output

type Output []OutputMetric

type OutputMetric

type OutputMetric struct {
	Name   string        `json:"name"`
	Unit   string        `json:"unit,omitempty"`
	Values []OutputValue `json:"values,omitempty"`
}

type OutputValue

type OutputValue struct {
	Context []string    `json:"context,omitempty"`
	Value   interface{} `json:"value"`
}

type Result

type Result struct {
	Unit  string
	Value interface{}
}

type Setting

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

func GetSetting

func GetSetting(name string, context ...string) *Setting

func (*Setting) Result

func (s *Setting) Result() Result

func (*Setting) Set

func (s *Setting) Set(value any) *Setting

type Timer

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

func GetTimer

func GetTimer(name string, reuse bool, context ...string) *Timer

func (*Timer) Result

func (t *Timer) Result() Result

func (*Timer) Start

func (t *Timer) Start() *Timer

func (*Timer) Stop

func (t *Timer) Stop() *Timer

type Type

type Type string
const (
	TypeCounter Type = "counter"
	TypeTimer   Type = "timer"
	TypeSetting Type = "setting"
)

Jump to

Keyboard shortcuts

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