metric

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 6 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

This section is empty.

Types

type Collector

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

func NewCollector

func NewCollector(opts ...MetricsCollectorOption) *Collector

func (*Collector) Add

func (mc *Collector) Add(name string, value float64, labels map[string]string, options ...pkg.MetricCollectorOption)

Add adds custom value for Counter metric

func (*Collector) CollectedMetrics

func (mc *Collector) CollectedMetrics() []metric.Operation

func (*Collector) Expire

func (mc *Collector) Expire(group string)

Expire marks metric's group as expired

func (*Collector) Inc

func (mc *Collector) Inc(name string, labels map[string]string, opts ...pkg.MetricCollectorOption)

Inc increments specified Counter metric

func (*Collector) Set

func (mc *Collector) Set(name string, value float64, labels map[string]string, options ...pkg.MetricCollectorOption)

Set specifies custom value for Gauge metric

func (*Collector) WithDefaultGroup

func (mc *Collector) WithDefaultGroup(group string)

func (*Collector) WriteOutput

func (mc *Collector) WriteOutput(w io.Writer) error

type MetricsCollectorOption

type MetricsCollectorOption interface {
	Apply(op MetricsCollectorOptionApplier)
}

type MetricsCollectorOptionApplier

type MetricsCollectorOptionApplier interface {
	WithDefaultGroup(group string)
}

type Option

type Option func(o MetricsCollectorOptionApplier)

func WithDefaultGroup

func WithDefaultGroup(group string) Option

func (Option) Apply

Jump to

Keyboard shortcuts

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