metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 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 Collector

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

func NewCollector

func NewCollector(now time.Time) *Collector

func (*Collector) RecordIdleCleanup

func (c *Collector) RecordIdleCleanup(now time.Time, evicted int)

func (*Collector) RecordOperation

func (c *Collector) RecordOperation(name string, duration time.Duration, err error)

func (*Collector) RecordPoolClosed

func (c *Collector) RecordPoolClosed()

func (*Collector) RecordPoolCreated

func (c *Collector) RecordPoolCreated()

func (*Collector) Snapshot

func (c *Collector) Snapshot(now time.Time) Snapshot

type OperationSnapshot

type OperationSnapshot struct {
	Name              string
	Requests          int64
	Successes         int64
	Failures          int64
	AverageDurationMs int64
	LastDurationMs    int64
}

type Snapshot

type Snapshot struct {
	StartedAt          time.Time
	UptimeSeconds      int64
	TotalPoolsCreated  int64
	TotalPoolsClosed   int64
	IdlePoolsEvicted   int64
	IdleCleanupRuns    int64
	LastIdleCleanupAt  *time.Time
	LastIdleEvictionAt *time.Time
	Operations         []OperationSnapshot
}

Jump to

Keyboard shortcuts

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