metrics

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 7 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 Metric

type Metric interface {
	// Register a metric
	Register(metric.Meter) error

	// Observe the metric
	Observe(context.Context, metric.Observer) error
}

type Metrics

type Metrics struct {
	metric.Meter
	Conn pg.Conn
	// contains filtered or unexported fields
}

func New

func New(r io.Reader, meter metric.Meter, conn pg.PoolConn) (*Metrics, error)

func (*Metrics) Add

func (m *Metrics) Add(metric Metric) error

func (*Metrics) Run

func (m *Metrics) Run(ctx context.Context) error

Run metrics until the context is cancelled.

type UserMetric

type UserMetric struct {
	Status string
	Count  uint64
}

type UserMetrics

type UserMetrics struct {
	Body []UserMetric
	// contains filtered or unexported fields
}

func (*UserMetrics) Observe

func (u *UserMetrics) Observe(ctx context.Context, observer metric.Observer) error

Observe the metric

func (*UserMetrics) Register

func (u *UserMetrics) Register(meter metric.Meter, conn pg.Conn) error

Register a metric

func (*UserMetrics) Scan

func (u *UserMetrics) Scan(row pg.Row) error

func (UserMetrics) Select

func (UserMetrics) Select(bind *pg.Bind, _ pg.Op) (string, error)

Jump to

Keyboard shortcuts

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