aggregate

package
v0.8.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2019 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Index

Constants

View Source
const (
	AggregateLabel    = "Aggregate"
	CrossSeriesSuffix = "_all"
)

Aggregation functions

Variables

This section is empty.

Functions

func AggregatesFromStringListWithCount added in v0.8.3

func AggregatesFromStringListWithCount(split []string) (AggrType, []AggrType, error)

Convert a comma-separated aggregation-functions string to an aggregates mask

func ContainsAggregate added in v0.8.3

func ContainsAggregate(list []AggrType, item AggrType) bool

func GetClientAggregationsFunction added in v0.8.3

func GetClientAggregationsFunction(aggr AggrType) (func(interface{}, interface{}) interface{}, error)

func GetServerAggregationsFunction added in v0.8.3

func GetServerAggregationsFunction(aggr AggrType) (func(interface{}, interface{}) interface{}, error)

func GetServerVirtualAggregationFunction added in v0.8.3

func GetServerVirtualAggregationFunction(aggr AggrType) (func([]float64) float64, error)

func HasAggregates added in v0.8.3

func HasAggregates(mask AggrType) bool

func IsCountAggregate added in v0.8.3

func IsCountAggregate(aggr AggrType) bool

func IsRawAggregate added in v0.8.3

func IsRawAggregate(item AggrType) bool

func ParseCrossLabelSets added in v0.8.8

func ParseCrossLabelSets(str string) [][]string

func RawAggregatesToStringList added in v0.8.3

func RawAggregatesToStringList(aggregates string) ([]string, error)

func SchemaFieldFromString added in v0.0.3

func SchemaFieldFromString(aggregates []string, col string) ([]config.SchemaField, error)

func ToAttrName added in v0.8.3

func ToAttrName(aggr AggrType) string

Types

type AggrType

type AggrType uint16

func AggregateFromString added in v0.8.3

func AggregateFromString(aggrString string) (AggrType, error)

func GetDependantAggregates added in v0.8.3

func GetDependantAggregates(aggr AggrType) []AggrType

func GetHiddenAggregates added in v0.8.3

func GetHiddenAggregates(mask AggrType, requestedAggregates []AggrType) []AggrType

func GetHiddenAggregatesWithCount added in v0.8.3

func GetHiddenAggregatesWithCount(mask AggrType, requestedAggregates []AggrType) []AggrType

func (AggrType) HasAverage added in v0.0.12

func (a AggrType) HasAverage() bool

func (AggrType) String

func (a AggrType) String() string

type Aggregate added in v0.0.13

type Aggregate interface {
	Aggregate(t int64, v float64)
	Clear()
	GetAttr() string
	UpdateExpr(col string, bucket int) string
	SetExpr(col string, bucket int) string
	InitExpr(col string, buckets int) string
}

type AggregateSeries

type AggregateSeries struct {
	// contains filtered or unexported fields
}

func NewAggregateSeries

func NewAggregateSeries(functions, col string, buckets int, interval, rollupTime int64, windows []int) (*AggregateSeries, error)

func (*AggregateSeries) CanAggregate

func (as *AggregateSeries) CanAggregate(partitionAggr AggrType) bool

func (*AggregateSeries) GetAggrMask

func (as *AggregateSeries) GetAggrMask() AggrType

func (*AggregateSeries) GetAttrNames

func (as *AggregateSeries) GetAttrNames() []string

func (*AggregateSeries) GetFunctions

func (as *AggregateSeries) GetFunctions() []AggrType

func (*AggregateSeries) NewSetFromAttrs

func (as *AggregateSeries) NewSetFromAttrs(
	length, start, end int, mint, maxt int64, attrs *map[string]interface{}) (*AggregateSet, error)

create new aggregation set from v3io aggregation array attributes

func (*AggregateSeries) NewSetFromChunks

func (as *AggregateSeries) NewSetFromChunks(length int) *AggregateSet

prepare new aggregation set from v3io raw chunk attributes (in case there are no aggregation arrays)

func (*AggregateSeries) NumFunctions

func (as *AggregateSeries) NumFunctions() int

type AggregateSet

type AggregateSet struct {
	// contains filtered or unexported fields
}

func (*AggregateSet) AppendAllCells

func (as *AggregateSet) AppendAllCells(cell int, val float64)

append the value to a cell in all relevant aggregation arrays

func (*AggregateSet) Clear

func (as *AggregateSet) Clear()

func (*AggregateSet) GetCellTime

func (as *AggregateSet) GetCellTime(base int64, index int) int64

get the time per aggregate cell

func (*AggregateSet) GetCellValue

func (as *AggregateSet) GetCellValue(aggr AggrType, cell int) (float64, bool)

return the value per aggregate or complex function

func (*AggregateSet) GetMaxCell

func (as *AggregateSet) GetMaxCell() int

func (*AggregateSet) HasData added in v0.8.0

func (as *AggregateSet) HasData(cell int) bool

Check if cell has data. Assumes that count is always present

type AggregatesList added in v0.0.13

type AggregatesList []Aggregate

List of aggregates

func NewAggregatesList added in v0.0.13

func NewAggregatesList(aggrType AggrType) *AggregatesList

Create a list of aggregate objects from an aggregates mask

func (AggregatesList) Aggregate added in v0.0.13

func (a AggregatesList) Aggregate(t int64, val interface{})

Append a value to all aggregates

func (AggregatesList) Clear added in v0.0.13

func (a AggregatesList) Clear()

Clear all aggregates

func (AggregatesList) InitExpr added in v0.0.13

func (a AggregatesList) InitExpr(col string, buckets int) string

Return an aggregates array-initialization expression

func (AggregatesList) SetExpr added in v0.0.13

func (a AggregatesList) SetExpr(col string, bucket int) string

func (AggregatesList) SetOrUpdateExpr added in v0.0.13

func (a AggregatesList) SetOrUpdateExpr(col string, bucket int, isNew bool) string

Return an aggregates set expression (first value) or update expression

func (AggregatesList) UpdateExpr added in v0.0.13

func (a AggregatesList) UpdateExpr(col string, bucket int) string

Return an update expression for the aggregates in the given aggregates list

type AggregationParams added in v0.8.3

type AggregationParams struct {
	Interval int64 // requested (query) aggregation step
	// contains filtered or unexported fields
}

func NewAggregationParams added in v0.8.3

func NewAggregationParams(functions, col string, buckets int, interval, rollupTime int64, windows []int) (*AggregationParams, error)

func (*AggregationParams) CanAggregate added in v0.8.3

func (as *AggregationParams) CanAggregate(partitionAggr AggrType) bool

func (*AggregationParams) GetAggrMask added in v0.8.3

func (as *AggregationParams) GetAggrMask() AggrType

func (*AggregationParams) GetAttrNames added in v0.8.3

func (as *AggregationParams) GetAttrNames() []string

func (*AggregationParams) GetRollupTime added in v0.8.3

func (as *AggregationParams) GetRollupTime() int64

type CountAggregate added in v0.0.13

type CountAggregate struct {
	// contains filtered or unexported fields
}

Count aggregate

func (*CountAggregate) Aggregate added in v0.0.13

func (a *CountAggregate) Aggregate(t int64, v float64)

func (*CountAggregate) Clear added in v0.0.13

func (a *CountAggregate) Clear()

func (*CountAggregate) GetAttr added in v0.0.13

func (a *CountAggregate) GetAttr() string

func (*CountAggregate) InitExpr added in v0.0.13

func (a *CountAggregate) InitExpr(col string, buckets int) string

func (*CountAggregate) SetExpr added in v0.0.13

func (a *CountAggregate) SetExpr(col string, bucket int) string

func (*CountAggregate) UpdateExpr added in v0.0.13

func (a *CountAggregate) UpdateExpr(col string, bucket int) string

type FloatAggregate added in v0.0.13

type FloatAggregate struct {
	// contains filtered or unexported fields
}

base float64 Aggregate

func (*FloatAggregate) Clear added in v0.0.13

func (a *FloatAggregate) Clear()

func (*FloatAggregate) GetAttr added in v0.0.13

func (a *FloatAggregate) GetAttr() string

func (*FloatAggregate) GetVal added in v0.0.13

func (a *FloatAggregate) GetVal() float64

func (*FloatAggregate) InitExpr added in v0.0.13

func (a *FloatAggregate) InitExpr(col string, buckets int) string

func (*FloatAggregate) SetExpr added in v0.0.13

func (a *FloatAggregate) SetExpr(col string, bucket int) string

func (*FloatAggregate) UpdateExpr added in v0.0.13

func (a *FloatAggregate) UpdateExpr(col string, bucket int) string

type LastAggregate added in v0.0.13

type LastAggregate struct {
	FloatAggregate
	// contains filtered or unexported fields
}

Last value Aggregate

func (*LastAggregate) Aggregate added in v0.0.13

func (a *LastAggregate) Aggregate(t int64, v float64)

func (*LastAggregate) Clear added in v0.0.13

func (a *LastAggregate) Clear()

func (*LastAggregate) UpdateExpr added in v0.0.13

func (a *LastAggregate) UpdateExpr(col string, bucket int) string

type MaxAggregate added in v0.0.13

type MaxAggregate struct{ FloatAggregate }

Maximum Aggregate

func (*MaxAggregate) Aggregate added in v0.0.13

func (a *MaxAggregate) Aggregate(t int64, v float64)

func (*MaxAggregate) Clear added in v0.0.13

func (a *MaxAggregate) Clear()

func (*MaxAggregate) UpdateExpr added in v0.0.13

func (a *MaxAggregate) UpdateExpr(col string, bucket int) string

type MinAggregate added in v0.0.13

type MinAggregate struct{ FloatAggregate }

Minimum Aggregate

func (*MinAggregate) Aggregate added in v0.0.13

func (a *MinAggregate) Aggregate(t int64, v float64)

func (*MinAggregate) Clear added in v0.0.13

func (a *MinAggregate) Clear()

func (*MinAggregate) UpdateExpr added in v0.0.13

func (a *MinAggregate) UpdateExpr(col string, bucket int) string

type SqrAggregate added in v0.0.13

type SqrAggregate struct{ FloatAggregate }

Power of 2 Aggregate

func (*SqrAggregate) Aggregate added in v0.0.13

func (a *SqrAggregate) Aggregate(t int64, v float64)

type SumAggregate added in v0.0.13

type SumAggregate struct{ FloatAggregate }

Sum Aggregate

func (*SumAggregate) Aggregate added in v0.0.13

func (a *SumAggregate) Aggregate(t int64, v float64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL