Documentation ¶
Overview ¶
package tsdb contains the data structures for emulating the TSDB API. The tsdb package must not depend on any other scotty packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator interface { // Add adds a time series Add(values TimeSeries) // Aggregate returns the aggregated time series. Aggregate() TimeSeries }
Aggregator aggregates time series together.
type AggregatorGenerator ¶
type AggregatorGenerator func(start, end float64) (Aggregator, error)
AggregatorGenerator produces Aggregator values. start is the start time for the aggregator inclusive; end is the end time for the aggregator exclusive. start and end are seconds since Jan 1, 1970.
type TagFilter ¶
TagFilter represents an arbitrary filter on a tag value. Filter returns true if a given tag value should be included or false otherwise.
type TaggedTimeSeries ¶
type TaggedTimeSeries struct { Tags TagSet Values TimeSeries }
TaggedTimeSeries represents a single tagged timeSeries.
type TaggedTimeSeriesSet ¶
type TaggedTimeSeriesSet struct { // The metric name MetricName string // the data Data []TaggedTimeSeries // If true, Data is grouped by the "HostName" tag GroupedByHostName bool // If true, Data is grouped by the "appname" tag GroupedByAppName bool // If true, Data is grouped by the "region" tag GroupedByRegion bool // If true, data is grouped by the "ipaddress" tag GroupedByIpAddress bool }
TaggedTimeSeriesSet represets a set of tagged time series
type TimeSeries ¶
type TimeSeries []TsValue
TimeSeries represents a time series. TimeSeries are time stamped values sorted by time stamp in ascending order. TimeSeries contain values for all known time stamps even if the value hasn't changed. TimeSeries instances must be treated as immutable.
func (TimeSeries) EarlyTruncate ¶
func (t TimeSeries) EarlyTruncate(earliest float64) TimeSeries
EarlyTruncate returns a time series like this one but without any times before earliest.
func (TimeSeries) MarshalJSON ¶
func (t TimeSeries) MarshalJSON() ([]byte, error)
MarshalJSON satisfies the encoding/json.Marshaler interface and allows correct JSON encoding of TimeSeries values. In particular, time series must be encoded as {"secondsSinceEpoch1":value1, "secondsSinceEpoch2":value2, ...} in ascending order by time.
Directories ¶
Path | Synopsis |
---|---|
Package aggregators contains aggregator factory methods.
|
Package aggregators contains aggregator factory methods. |