Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DayStore ¶
type DayStore struct { // a RWMutex guards all operations on the underlying window and cached values. sync.RWMutex // Hour is a StatStore with data from the last one hour Hour *statstore.StatStore // contains filtered or unexported fields }
Note on how derived stats are extracted: If the DayStore holds less than 1 hour of data, then the average, max and 95th are - calculated only from the the Hour store.
If the DayStore holds more than 1 hour of data, then the average and 95th are calculated - only from the 24 past hourly stats that have been collected. Assuming a resolution of 1 minute, this behavior may ignore up to 59 minutes of the latest data. This behavior is required to avoid calculating less than a full day's data. In order to correctly capture spikes, the Max takes into account the latest data, causing the - max to reflect values in the past [24 hours, 25 hours)
func NewDayStore ¶
NewDayStore is a DayStore constructor. The recommended minimum resolution is at least one minute.
func (*DayStore) Average ¶
Average returns the average value of the hourly averages in the past day.
func (*DayStore) NinetyFifth ¶
NinetyFifth returns the 95th percentile of the hourly 95th percentiles in the past day.