Documentation ¶
Index ¶
- Variables
- type GetValueOrNaN
- type NextMetric
- type Point
- type Points
- func (pp *Points) AppendPoint(metricID uint32, value float64, time uint32, version uint32)
- func (pp *Points) GetAggregation(id uint32) (string, error)
- func (pp *Points) GetStep(id uint32) (uint32, error)
- func (pp *Points) GroupByMetric() NextMetric
- func (pp *Points) Len() int
- func (pp *Points) Less(i, j int) bool
- func (pp *Points) List() []Point
- func (pp *Points) MetricID(metricName string) uint32
- func (pp *Points) MetricIDBytes(metricNameBytes []byte) uint32
- func (pp *Points) MetricName(metricID uint32) string
- func (pp *Points) ReplaceList(list []Point)
- func (pp *Points) SetAggregations(functions map[string][]string)
- func (pp *Points) SetSteps(steps map[uint32][]string)
- func (pp *Points) Sort()
- func (pp *Points) Swap(i, j int)
- func (pp *Points) Uniq()
Constants ¶
This section is empty.
Variables ¶
var ErrPointsUnsorted = fmt.Errorf("the points are unsorted")
ErrPointsUnsorted returns for unsorted []Point or Points
var ErrTimeGreaterStop = fmt.Errorf("the points for time interval are rover")
ErrTimeGreaterStop shows the correct over for GetValueOrNaN
var ErrWrongMetricID = fmt.Errorf("the point MetricID is wrong")
ErrWrongMetricID shows the Point.MetricID is wrong somehow
Functions ¶
This section is empty.
Types ¶
type GetValueOrNaN ¶ added in v0.13.0
GetValueOrNaN returns Value for the next point or NaN if the value is omited. ErrTimeGreaterStop shows the normal ending. Any else error is considered as real error
func FillNulls ¶ added in v0.13.0
func FillNulls(points []Point, from, until, step uint32) (start, stop, count uint32, getter GetValueOrNaN)
FillNulls accepts an ordered []Point for one metric and returns a generator that will return all points for specific interval. Generator returns EmptyPoint when it's finished
type NextMetric ¶ added in v0.13.0
type NextMetric func() []Point
NextMetric returns the list of points for one metric name
type Point ¶
type Point struct { MetricID uint32 Value float64 Time uint32 Timestamp uint32 // keep max if metric and time equal on two points }
type Points ¶ added in v0.6.2
type Points struct {
// contains filtered or unexported fields
}
Points is a structure that stores points and additional information about them, e.g. steps, aggregating functions and names.
func (*Points) AppendPoint ¶ added in v0.6.2
AppendPoint creates a Point with given values and appends it to list
func (*Points) GetAggregation ¶ added in v0.13.0
GetAggregation returns string function for given metric id.
func (*Points) GroupByMetric ¶ added in v0.13.0
func (pp *Points) GroupByMetric() NextMetric
GroupByMetric returns NextMetric function, that by each call returns points for one next metric. It should be called only on sorted and cleaned Points.
func (*Points) MetricID ¶ added in v0.6.2
MetricID checks if metric name already exists and returns the ID for it. If not, it creates it first.
func (*Points) MetricIDBytes ¶ added in v0.11.6
MetricIDBytes checks if metric name already exists and returns the ID for it. If not, it creates it first.
func (*Points) MetricName ¶ added in v0.6.2
MetricName returns name for metric with given metricID or empty string when ID does not exist
func (*Points) ReplaceList ¶ added in v0.12.0
ReplaceList replaces list of points
func (*Points) SetAggregations ¶ added in v0.13.0
SetAggregations accepts map of metric name as keys and function as values and sets slice of functions for existing metrics in Data.Points
func (*Points) SetSteps ¶ added in v0.12.0
SetSteps accepts map of metric name as keys and step as values and sets slice of uint32 steps for existing metrics in Data.Points