metrics

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

Metrics records database operation metrics for one Prometheus namespace. Instances are safe for concurrent use.

func New

func New(namespace string) *Metrics

New returns the shared database metric set for namespace. Passing an empty namespace creates metrics without a namespace prefix.

Metric sets are shared by namespace to prevent duplicate collector registration when multiple database replicas use the same namespace.

func (*Metrics) Observe

func (m *Metrics) Observe(replica, operation, status string, durationSeconds float64)

Observe records the duration and increments the count for a database operation.

Jump to

Keyboard shortcuts

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