Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 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 Histogram

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

func NewHistogram

func NewHistogram() *Histogram

func (*Histogram) Count

func (h *Histogram) Count() uint64

func (*Histogram) Max

func (h *Histogram) Max() time.Duration

func (*Histogram) Mean

func (h *Histogram) Mean() time.Duration

func (*Histogram) Min

func (h *Histogram) Min() time.Duration

func (*Histogram) P50

func (h *Histogram) P50() time.Duration

func (*Histogram) P95

func (h *Histogram) P95() time.Duration

func (*Histogram) P99

func (h *Histogram) P99() time.Duration

func (*Histogram) Percentile

func (h *Histogram) Percentile(q float64) time.Duration

func (*Histogram) Record

func (h *Histogram) Record(d time.Duration)

type Result

type Result struct {
	Latency   time.Duration
	Success   bool
	Timestamp time.Time
	Err       error
}

type Stats

type Stats struct {
	TotalRequests int
	SuccessCount  int
	FailureCount  int
	Latencies     []time.Duration
	Hist          *Histogram
}

func Collector

func Collector(results <-chan Result) Stats

func NewStats

func NewStats() *Stats

func (*Stats) Average

func (s *Stats) Average() time.Duration

func (*Stats) Max

func (s *Stats) Max() time.Duration

func (*Stats) Median

func (s *Stats) Median() time.Duration

func (*Stats) Min

func (s *Stats) Min() time.Duration

func (*Stats) P95

func (s *Stats) P95() time.Duration

func (*Stats) P99

func (s *Stats) P99() time.Duration

func (*Stats) Percentile

func (s *Stats) Percentile(p float64) time.Duration

func (*Stats) Record

func (s *Stats) Record(d time.Duration)

Jump to

Keyboard shortcuts

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