aggregate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggrType

type AggrType uint16

func AggrsFromString

func AggrsFromString(list string) (AggrType, error)

convert comma separated string to aggregator mask

func (AggrType) String

func (a AggrType) String() 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

return the value per aggregate or complex function

func (*AggregateSet) GetMaxCell

func (as *AggregateSet) GetMaxCell() int

type Aggregator

type Aggregator 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 AggregatorList

type AggregatorList []Aggregator

list of aggregators

func NewAggregatorList

func NewAggregatorList(aggrType AggrType) *AggregatorList

create list of aggregator objects from aggregator mask

func (AggregatorList) Aggregate

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

append value to all aggregators

func (AggregatorList) Clear

func (a AggregatorList) Clear()

clear all aggregators

func (AggregatorList) InitExpr

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

return array init expression

func (AggregatorList) SetExpr

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

func (AggregatorList) SetOrUpdateExpr

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

return set (first value) or update expression for aggregators

func (AggregatorList) UpdateExpr

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

return update expression for aggregators

type CountAggregator

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

Count aggregator

func (*CountAggregator) Aggregate

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

func (*CountAggregator) Clear

func (a *CountAggregator) Clear()

func (*CountAggregator) GetAttr

func (a *CountAggregator) GetAttr() string

func (*CountAggregator) InitExpr

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

func (*CountAggregator) SetExpr

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

func (*CountAggregator) UpdateExpr

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

type FloatAggregator

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

base float64 Aggregator

func (*FloatAggregator) Clear

func (a *FloatAggregator) Clear()

func (*FloatAggregator) GetAttr

func (a *FloatAggregator) GetAttr() string

func (*FloatAggregator) GetVal

func (a *FloatAggregator) GetVal() float64

func (*FloatAggregator) InitExpr

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

func (*FloatAggregator) SetExpr

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

func (*FloatAggregator) UpdateExpr

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

type LastAggregator

type LastAggregator struct {
	FloatAggregator
	// contains filtered or unexported fields
}

Last value Aggregator

func (*LastAggregator) Aggregate

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

func (*LastAggregator) Clear

func (a *LastAggregator) Clear()

func (*LastAggregator) UpdateExpr

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

type MaxAggregator

type MaxAggregator struct{ FloatAggregator }

Maximum Aggregator

func (*MaxAggregator) Aggregate

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

func (*MaxAggregator) Clear

func (a *MaxAggregator) Clear()

func (*MaxAggregator) UpdateExpr

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

type MinAggregator

type MinAggregator struct{ FloatAggregator }

Minimum Aggregator

func (*MinAggregator) Aggregate

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

func (*MinAggregator) Clear

func (a *MinAggregator) Clear()

func (*MinAggregator) UpdateExpr

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

type SqrAggregator

type SqrAggregator struct{ FloatAggregator }

Power of 2 Aggregator

func (*SqrAggregator) Aggregate

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

type SumAggregator

type SumAggregator struct{ FloatAggregator }

Sum Aggregator

func (*SumAggregator) Aggregate

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

Jump to

Keyboard shortcuts

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