aggregate

package
v0.9.23 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 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 MaskToString added in v0.9.15

func MaskToString(mask AggrType) string

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 FromString added in v0.9.15

func FromString(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 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, aggregationWindow, rollupTime int64,
	windows []int,
	disableClientAggregation bool,
	useServerAggregateCoefficient 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) GetAggregationWindow added in v0.9.0

func (as *AggregationParams) GetAggregationWindow() int64

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

func (*AggregationParams) HasAggregationWindow added in v0.9.0

func (as *AggregationParams) HasAggregationWindow() bool

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 Series added in v0.9.15

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

func NewAggregateSeries

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

func (*Series) CanAggregate added in v0.9.15

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

func (*Series) GetAggrMask added in v0.9.15

func (as *Series) GetAggrMask() AggrType

func (*Series) GetAttrNames added in v0.9.15

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

func (*Series) GetFunctions added in v0.9.15

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

func (*Series) NewSetFromAttrs added in v0.9.15

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

create new aggregation set from v3io aggregation array attributes

func (*Series) NewSetFromChunks added in v0.9.15

func (as *Series) NewSetFromChunks(length int) *Set

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

func (*Series) NumFunctions added in v0.9.15

func (as *Series) NumFunctions() int

type Set added in v0.9.15

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

func (*Set) AppendAllCells added in v0.9.15

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

append the value to a cell in all relevant aggregation arrays

func (*Set) Clear added in v0.9.15

func (as *Set) Clear()

func (*Set) GetCellTime added in v0.9.15

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

get the time per aggregate cell

func (*Set) GetCellValue added in v0.9.15

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

return the value per aggregate or complex function

func (*Set) GetMaxCell added in v0.9.15

func (as *Set) GetMaxCell() int

func (*Set) HasData added in v0.9.15

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

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

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