metrics

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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