package timeseries

Import Path
	golang.org/x/net/internal/timeseries (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files Package timeseries implements a time series structure for stats collection.
Package-Level Type Names (total 8, in which 5 are exported)
/* sort exporteds by: | */
A Clock tells the current time. ( Clock) Time() time.Time func NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries func NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries
Float attaches the methods of Observable to a float64. (*Float) Add(other Observable) (*Float) Clear() (*Float) CopyFrom(other Observable) (*Float) Multiply(ratio float64) String returns the float as a string. Value returns the float's value. *Float : Observable *Float : expvar.Var *Float : fmt.Stringer
MinuteHourSeries tracks data at granularities of 1 minute and 1 hour. Add records an observation at the current time. AddWithTime records an observation at the specified time. Clear removes all observations from the time series. ComputeRange computes a specified number of values into a slice using the observations recorded over the specified time period. The return values are approximate if the start or finish times don't fall on the bucket boundaries at the same level or if the number of buckets spanning the range is not an integral multiple of num. (*MinuteHourSeries) Hour() Observable Latest returns the sum of the num latest buckets from the level. LatestBuckets returns a copy of the num latest buckets from level. (*MinuteHourSeries) Minute() Observable Range returns the sum of observations added over the specified time range. If start or finish times don't fall on bucket boundaries of the same level, then return values are approximate answers. Recent returns the sum of observations from the last delta. RecentList returns the specified number of values in slice over the most recent time period of the specified range. ScaleBy updates observations by scaling by factor. Total returns the total of all observations. func NewMinuteHourSeries(f func() Observable) *MinuteHourSeries func NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries
An Observable is a kind of data that can be aggregated in a time series. // Adds the data from a different observation to self // Clears the observation so it can be reused. // Copies the contents of a given observation to self // Multiplies the data in self by a given ratio *Float func NewFloat() Observable func (*MinuteHourSeries).Hour() Observable func (*MinuteHourSeries).Minute() Observable func (*Float).Add(other Observable) func (*Float).CopyFrom(other Observable) func Observable.Add(other Observable) func Observable.CopyFrom(other Observable)
TimeSeries tracks data at granularities from 1 second to 16 weeks. Add records an observation at the current time. AddWithTime records an observation at the specified time. Clear removes all observations from the time series. ComputeRange computes a specified number of values into a slice using the observations recorded over the specified time period. The return values are approximate if the start or finish times don't fall on the bucket boundaries at the same level or if the number of buckets spanning the range is not an integral multiple of num. Latest returns the sum of the num latest buckets from the level. LatestBuckets returns a copy of the num latest buckets from level. Range returns the sum of observations added over the specified time range. If start or finish times don't fall on bucket boundaries of the same level, then return values are approximate answers. Recent returns the sum of observations from the last delta. RecentList returns the specified number of values in slice over the most recent time period of the specified range. ScaleBy updates observations by scaling by factor. Total returns the total of all observations. func NewTimeSeries(f func() Observable) *TimeSeries func NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries
Package-Level Functions (total 7, in which 5 are exported)
NewFloat returns a Float.
NewMinuteHourSeries creates a new MinuteHourSeries using the function provided for creating new Observable.
NewMinuteHourSeriesWithClock creates a new MinuteHourSeries using the function provided for creating new Observable and the clock for assigning timestamps.
NewTimeSeries creates a new TimeSeries using the function provided for creating new Observable.
NewTimeSeriesWithClock creates a new TimeSeries using the function provided for creating new Observable and the clock for assigning timestamps.
Package-Level Variables (total 3, none are exported)
Package-Level Constants (total 2, neither is exported)