Documentation ¶
Index ¶
- type StatStore
- func (ss *StatStore) Average() (uint64, error)
- func (ss *StatStore) Get(start, end time.Time) []TimePoint
- func (ss *StatStore) IsEmpty() bool
- func (ss *StatStore) Last() (TimePoint, uint64, error)
- func (ss *StatStore) Max() (uint64, error)
- func (ss *StatStore) MaxSize() time.Duration
- func (ss *StatStore) Percentile(p float64) (uint64, error)
- func (ss *StatStore) Put(tp TimePoint) error
- type TimePoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatStore ¶
type StatStore struct { // A RWMutex guards all operations on the StatStore. sync.RWMutex // contains filtered or unexported fields }
StatStore is a TimeStore-like object that does not implement the TimeStore interface.
func NewStatStore ¶
func (*StatStore) Average ¶
Average returns a weighted average across all buckets, using the count of - resolutions at each bucket as the weight.
func (*StatStore) Get ¶
Get generates a []TimePoint from the appropriate tpEntries. Get receives a start and end time as parameters. If start or end are equal to time.Time{}, then we consider no such bound.
func (*StatStore) Last ¶
Last returns the latest TimePoint, representing the average value of lastPut. Last also returns the max value of all Puts represented in lastPut. Last returns an error if no Put operations have been performed on the StatStore.
func (*StatStore) Max ¶
Max returns the maximum element currently in the StatStore. Max does NOT consider the case where the maximum is in the last one minute.
func (*StatStore) MaxSize ¶
MaxSize returns the total duration of data that can be stored in the StatStore.
func (*StatStore) Percentile ¶
Percentile returns the requested percentile from the StatStore.