metrics

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricTotal    = "worker_handler_execution_total"
	MetricDuration = "worker_handler_execution_duration_seconds"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Fil func(error) bool
	Han handler.Interface
	Log logger.Interface
	Nam string
	Reg registry.Interface
}

type Metrics

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

func New

func New(c Config) *Metrics

func (*Metrics) Active added in v0.7.0

func (m *Metrics) Active() bool

Active only forwards the scheduler primitive of the wrapped handler implementation. That means the metrics handler does not have its own activation setting, but only acts as proxy for the underlying handler.

func (*Metrics) Cooler

func (m *Metrics) Cooler() time.Duration

Cooler only forwards the cooler of the wrapped handler implementation. That means the metrics handler does not have its own cooler setting, but only acts as proxy for the underlying handler.

func (*Metrics) Ensure

func (m *Metrics) Ensure() error

Ensure tracks the start time of its own execution and runs the business logic of the wrapped worker handler. The wrapped business logic is instrumented for runtime latency and error rates. Note that Ensure emits debug logs about the internal worker handler execution. Any error returned originates from the underlying handler implementation, not from the metrics collection process.

func (*Metrics) Unwrap added in v0.5.0

func (m *Metrics) Unwrap() handler.Ensure

Unwrap only forwards the unwrap of the wrapped handler implementation. That means the metrics handler does not have its own unwrap behaviour, but only acts as proxy for the underlying handler.

Jump to

Keyboard shortcuts

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