metrics

package
v1.0.0 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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