Documentation ¶
Index ¶
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Purple = "\033[35m" )
ANSI color codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stats ¶
type Stats struct { MinTime time.Duration MaxTime time.Duration AvgTime time.Duration Count int Percent50 time.Duration Percent90 time.Duration Percent99 time.Duration }
Return stats as struct
type TimingStats ¶
type TimingStats struct { Count int TotalTime time.Duration MinTime time.Duration MaxTime time.Duration Timings []time.Duration // To keep track of individual timings for percentile calculation // contains filtered or unexported fields }
func NewTimingStats ¶
func NewTimingStats() *TimingStats
Initialize a TimingStats instance with reasonable defaults
func (*TimingStats) CalculatePercentile ¶
func (t *TimingStats) CalculatePercentile(percentile float64) time.Duration
Calculate percentile
func (*TimingStats) RecordTiming ¶
func (t *TimingStats) RecordTiming(duration time.Duration)
Record a new timing
Click to show internal directories.
Click to hide internal directories.