Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNegativeWindow = errors.New("window must be positive integer")
)
Functions ¶
This section is empty.
Types ¶
type Number ¶
type Number struct { Buckets map[int64]*numberBucket Mutex *sync.RWMutex // contains filtered or unexported fields }
Number tracks a numberBucket over a bounded Number of time buckets. Currently the buckets are one second long and only the last {window} seconds are kept.
func NewNumberWithWindow ¶
NewNumberWithWindow initializes a RollingNumber with window given
type Timing ¶
type Timing struct { Buckets map[int64]*timingBucket Mutex *sync.RWMutex CachedSortedDurations []time.Duration LastCachedTime int64 }
Timing maintains time Durations for each time bucket. The Durations are kept in an array to allow for a variety of statistics to be calculated from the source data.
func (*Timing) Percentile ¶
Percentile computes the percentile given with a linear interpolation.
func (*Timing) SortedDurations ¶
SortedDurations returns an array of time.Duration sorted from shortest to longest that have occurred in the last 60 seconds.
Click to show internal directories.
Click to hide internal directories.