engine

package
v0.4.1-0...-a8f6f26 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2014 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALL_GROUP_IDENTIFIER = Group0{}

Functions

func SortInt64

func SortInt64(ints []int64)

Types

type AbstractAggregator

type AbstractAggregator struct {
	Aggregator
	// contains filtered or unexported fields
}

func (*AbstractAggregator) InitializeFieldsMetadata

func (self *AbstractAggregator) InitializeFieldsMetadata(series *protocol.Series) error

type Aggregator

type Aggregator interface {
	AggregatePoint(series string, group interface{}, p *protocol.Point) error
	InitializeFieldsMetadata(series *protocol.Series) error
	GetValues(series string, group interface{}) [][]*protocol.FieldValue
	ColumnNames() []string
}

func NewCompositeAggregator

func NewCompositeAggregator(left, right Aggregator) (Aggregator, error)

func NewCountAggregator

func NewCountAggregator(q *parser.SelectQuery, v *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewCumulativeArithmeticAggregator

func NewCumulativeArithmeticAggregator(name string, value *parser.Value, initialValue float64, defaultValue *parser.Value, operation Operation) (Aggregator, error)

func NewDerivativeAggregator

func NewDerivativeAggregator(q *parser.SelectQuery, v *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewDistinctAggregator

func NewDistinctAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewFirstAggregator

func NewFirstAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewFirstOrLastAggregator

func NewFirstOrLastAggregator(name string, v *parser.Value, isFirst bool, defaultValue *parser.Value) (Aggregator, error)

func NewHistogramAggregator

func NewHistogramAggregator(q *parser.SelectQuery, v *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewLastAggregator

func NewLastAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewMaxAggregator

func NewMaxAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewMeanAggregator

func NewMeanAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewMedianAggregator

func NewMedianAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewMinAggregator

func NewMinAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewModeAggregator

func NewModeAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewPercentileAggregator

func NewPercentileAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewStandardDeviationAggregator

func NewStandardDeviationAggregator(q *parser.SelectQuery, v *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewSumAggregator

func NewSumAggregator(_ *parser.SelectQuery, value *parser.Value, defaultValue *parser.Value) (Aggregator, error)

func NewTimestampAggregator

func NewTimestampAggregator(query *parser.SelectQuery, _ *parser.Value) (Aggregator, error)

type AggregatorInitializer

type AggregatorInitializer func(*parser.SelectQuery, *parser.Value, *parser.Value) (Aggregator, error)

Initialize a new aggregator given the query, the function call of the aggregator and the default value that should be returned if the bucket doesn't have any points

type AscendingAggregatorSortableGroups

type AscendingAggregatorSortableGroups struct {
	CommonSortableGroups
	// contains filtered or unexported fields
}

func (*AscendingAggregatorSortableGroups) Less

func (self *AscendingAggregatorSortableGroups) Less(i, j int) bool

type AscendingGroupTimestampSortableGroups

type AscendingGroupTimestampSortableGroups struct {
	CommonSortableGroups
}

func (*AscendingGroupTimestampSortableGroups) Less

type CommonSortableGroups

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

func (*CommonSortableGroups) GetSortedGroups

func (self *CommonSortableGroups) GetSortedGroups() []Group

func (*CommonSortableGroups) Len

func (self *CommonSortableGroups) Len() int

func (*CommonSortableGroups) Swap

func (self *CommonSortableGroups) Swap(i, j int)

type CompositeAggregator

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

func (*CompositeAggregator) AggregatePoint

func (self *CompositeAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*CompositeAggregator) ColumnNames

func (self *CompositeAggregator) ColumnNames() []string

func (*CompositeAggregator) GetValues

func (self *CompositeAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

func (*CompositeAggregator) InitializeFieldsMetadata

func (self *CompositeAggregator) InitializeFieldsMetadata(series *protocol.Series) error

type CountAggregator

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

func (*CountAggregator) AggregatePoint

func (self *CountAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*CountAggregator) ColumnNames

func (self *CountAggregator) ColumnNames() []string

func (*CountAggregator) GetValues

func (self *CountAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

func (*CountAggregator) InitializeFieldsMetadata

func (self *CountAggregator) InitializeFieldsMetadata(series *protocol.Series) error

type CumulativeArithmeticAggregator

type CumulativeArithmeticAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*CumulativeArithmeticAggregator) AggregatePoint

func (self *CumulativeArithmeticAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*CumulativeArithmeticAggregator) ColumnNames

func (self *CumulativeArithmeticAggregator) ColumnNames() []string

func (*CumulativeArithmeticAggregator) GetValues

func (self *CumulativeArithmeticAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type DerivativeAggregator

type DerivativeAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*DerivativeAggregator) AggregatePoint

func (self *DerivativeAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*DerivativeAggregator) ColumnNames

func (self *DerivativeAggregator) ColumnNames() []string

func (*DerivativeAggregator) GetValues

func (self *DerivativeAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type DescendingAggregatorSortableGroups

type DescendingAggregatorSortableGroups struct {
	CommonSortableGroups
	// contains filtered or unexported fields
}

func (*DescendingAggregatorSortableGroups) Less

func (self *DescendingAggregatorSortableGroups) Less(i, j int) bool

type DescendingGroupTimestampSortableGroups

type DescendingGroupTimestampSortableGroups struct {
	CommonSortableGroups
}

func (*DescendingGroupTimestampSortableGroups) Less

type DistinctAggregator

type DistinctAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*DistinctAggregator) AggregatePoint

func (self *DistinctAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*DistinctAggregator) ColumnNames

func (self *DistinctAggregator) ColumnNames() []string

func (*DistinctAggregator) GetValues

func (self *DistinctAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type EngineI

type EngineI interface {
	RunQuery(user common.User, database string, query string, localOnly bool, yield func(*protocol.Series) error) error
}

func NewQueryEngine

func NewQueryEngine(c coordinator.Coordinator) (EngineI, error)

type FirstOrLastAggregator

type FirstOrLastAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*FirstOrLastAggregator) AggregatePoint

func (self *FirstOrLastAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*FirstOrLastAggregator) ColumnNames

func (self *FirstOrLastAggregator) ColumnNames() []string

func (*FirstOrLastAggregator) GetValues

func (self *FirstOrLastAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type Group

type Group interface {
	HasTimestamp() bool
	GetTimestamp() int64
	GetValue(int) interface{}
	WithoutTimestamp() Group
	WithTimestamp(int64) Group
}

type Group0

type Group0 struct {
	Group
}

func (Group0) GetTimestamp

func (self Group0) GetTimestamp() int64

func (Group0) GetValue

func (self Group0) GetValue(idx int) interface{}

func (Group0) HasTimestamp

func (self Group0) HasTimestamp() bool

func (Group0) WithTimestamp

func (self Group0) WithTimestamp(timestamp int64) Group

func (Group0) WithoutTimestamp

func (self Group0) WithoutTimestamp() Group

type Group1

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

func (Group1) GetTimestamp

func (self Group1) GetTimestamp() int64

func (Group1) GetValue

func (self Group1) GetValue(idx int) interface{}

func (Group1) HasTimestamp

func (self Group1) HasTimestamp() bool

func (Group1) WithTimestamp

func (self Group1) WithTimestamp(timestamp int64) Group

func (Group1) WithoutTimestamp

func (self Group1) WithoutTimestamp() Group

type Group2

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

func (Group2) GetTimestamp

func (self Group2) GetTimestamp() int64

func (Group2) GetValue

func (self Group2) GetValue(idx int) interface{}

func (Group2) HasTimestamp

func (self Group2) HasTimestamp() bool

func (Group2) WithTimestamp

func (self Group2) WithTimestamp(timestamp int64) Group

func (Group2) WithoutTimestamp

func (self Group2) WithoutTimestamp() Group

type Group3

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

func (Group3) GetTimestamp

func (self Group3) GetTimestamp() int64

func (Group3) GetValue

func (self Group3) GetValue(idx int) interface{}

func (Group3) HasTimestamp

func (self Group3) HasTimestamp() bool

func (Group3) WithTimestamp

func (self Group3) WithTimestamp(timestamp int64) Group

func (Group3) WithoutTimestamp

func (self Group3) WithoutTimestamp() Group

type HistogramAggregator

type HistogramAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*HistogramAggregator) AggregatePoint

func (self *HistogramAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*HistogramAggregator) ColumnNames

func (self *HistogramAggregator) ColumnNames() []string

func (*HistogramAggregator) GetValues

func (self *HistogramAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type Int64Slice

type Int64Slice []int64

Int64Slice attaches the methods of sort.Interface to []int64, sorting in increasing order.

func (Int64Slice) Len

func (p Int64Slice) Len() int

func (Int64Slice) Less

func (p Int64Slice) Less(i, j int) bool

func (Int64Slice) Swap

func (p Int64Slice) Swap(i, j int)

type Mapper

type Mapper func(*protocol.Point) Group

Mapper given a point returns a group identifier as the first return result and a non-time dependent group (the first group without time) as the second result

type MeanAggregator

type MeanAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*MeanAggregator) AggregatePoint

func (self *MeanAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*MeanAggregator) ColumnNames

func (self *MeanAggregator) ColumnNames() []string

func (*MeanAggregator) GetValues

func (self *MeanAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type ModeAggregator

type ModeAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*ModeAggregator) AggregatePoint

func (self *ModeAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*ModeAggregator) ColumnNames

func (self *ModeAggregator) ColumnNames() []string

func (*ModeAggregator) GetValues

func (self *ModeAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type Operation

type Operation func(currentValue float64, newValue *protocol.FieldValue) float64

type PercentileAggregator

type PercentileAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*PercentileAggregator) AggregatePoint

func (self *PercentileAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*PercentileAggregator) ColumnNames

func (self *PercentileAggregator) ColumnNames() []string

func (*PercentileAggregator) GetValues

func (self *PercentileAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type PointRange

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

func (*PointRange) UpdateRange

func (self *PointRange) UpdateRange(point *protocol.Point)

type PointSlice

type PointSlice []protocol.Point

type QueryEngine

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

func (*QueryEngine) RunQuery

func (self *QueryEngine) RunQuery(user common.User, database string, queryString string, localOnly bool, yield func(*protocol.Series) error) (err error)

type SortableGroups

type SortableGroups interface {
	sort.Interface
	GetSortedGroups() []Group
}

type StandardDeviationAggregator

type StandardDeviationAggregator struct {
	AbstractAggregator
	// contains filtered or unexported fields
}

func (*StandardDeviationAggregator) AggregatePoint

func (self *StandardDeviationAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*StandardDeviationAggregator) ColumnNames

func (self *StandardDeviationAggregator) ColumnNames() []string

func (*StandardDeviationAggregator) GetValues

func (self *StandardDeviationAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

type StandardDeviationRunning

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

type TimestampAggregator

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

func (*TimestampAggregator) AggregatePoint

func (self *TimestampAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error

func (*TimestampAggregator) ColumnNames

func (self *TimestampAggregator) ColumnNames() []string

func (*TimestampAggregator) GetValues

func (self *TimestampAggregator) GetValues(series string, group interface{}) [][]*protocol.FieldValue

func (*TimestampAggregator) InitializeFieldsMetadata

func (self *TimestampAggregator) InitializeFieldsMetadata(series *protocol.Series) error

Jump to

Keyboard shortcuts

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