metric

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

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