stats

package
v0.0.0-...-b66650a Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Record

func Record(storeName store.StoreName, method string, duration time.Duration, isError bool)

Types

type MethodStats

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

func (*MethodStats) Record

func (ms *MethodStats) Record(duration time.Duration, isError bool)

func (*MethodStats) Snapshot

func (ms *MethodStats) Snapshot(window time.Duration) MethodStatsSnapshot

type MethodStatsSnapshot

type MethodStatsSnapshot struct {
	TotalCount        int64   `json:"total_count"`
	ErrorCount        int64   `json:"error_count"`
	ErrorRate         float64 `json:"error_rate"`
	AvgDurationMs     float64 `json:"avg_duration_ms"`
	MinDurationMs     float64 `json:"min_duration_ms"`
	MaxDurationMs     float64 `json:"max_duration_ms"`
	P50DurationMs     float64 `json:"p50_duration_ms"`
	P95DurationMs     float64 `json:"p95_duration_ms"`
	P99DurationMs     float64 `json:"p99_duration_ms"`
	RequestsPerMinute float64 `json:"requests_per_minute"`
}

type MethodStatsSnapshotEntry

type MethodStatsSnapshotEntry struct {
	Name string `json:"name"`
	MethodStatsSnapshot
}

type StoreStats

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

func (*StoreStats) Record

func (ss *StoreStats) Record(method string, duration time.Duration, isError bool)

func (*StoreStats) Snapshot

func (ss *StoreStats) Snapshot(window time.Duration) map[string]MethodStatsSnapshot

type StoreStatsSnapshot

type StoreStatsSnapshot struct {
	Name    store.StoreName            `json:"name"`
	Methods []MethodStatsSnapshotEntry `json:"methods"`
}

func GetSnapshot

func GetSnapshot(window time.Duration) []StoreStatsSnapshot

Jump to

Keyboard shortcuts

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