metrics

package
v0.0.0-...-25bc77e Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatsHook

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

StatsHook publishes basic txoutbox counters via expvar.

func NewStatsHook

func NewStatsHook(prefix string) *StatsHook

NewStatsHook registers an expvar entry named "<prefix>_stats".

func (*StatsHook) OnClaim

func (h *StatsHook) OnClaim(_ context.Context, batchSize int, claimed int)

OnClaim tracks how many rows we attempted to claim and how many we actually received.

func (*StatsHook) OnCycle

func (h *StatsHook) OnCycle(_ context.Context, d time.Duration)

OnCycle records cycle durations and counts.

func (*StatsHook) OnFail

func (h *StatsHook) OnFail(_ context.Context, _ txoutbox.Envelope, _ int, _ error)

OnFail increments permanent failures.

func (*StatsHook) OnRetry

func (h *StatsHook) OnRetry(_ context.Context, _ txoutbox.Envelope, _ int, _ time.Duration)

OnRetry increments retry counters.

func (*StatsHook) OnSendFailure

func (h *StatsHook) OnSendFailure(_ context.Context, _ txoutbox.Envelope, _ error)

OnSendFailure increments failed deliveries before retry/fail handling.

func (*StatsHook) OnSendSuccess

func (h *StatsHook) OnSendSuccess(_ context.Context, _ txoutbox.Envelope)

OnSendSuccess increments successful deliveries.

func (*StatsHook) OnStoreError

func (h *StatsHook) OnStoreError(_ context.Context, _ string, _ int64, _ error)

OnStoreError increments store error counter.

Jump to

Keyboard shortcuts

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