Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AggregationOverTime = map[AggregateFunction]string{ MaxOverTime: "max_over_time", AvgOverTime: "avg_over_time", } TimeRange2AggregationOverTime = map[Common.TimeRange_AggregateFunction]AggregateFunction{ Common.TimeRange_NONE: None, Common.TimeRange_MAX: MaxOverTime, Common.TimeRange_AVG: AvgOverTime, } )
View Source
var (
DefaultStepTime, _ = time.ParseDuration("30s")
)
Functions ¶
This section is empty.
Types ¶
type AggregateFunction ¶
type AggregateFunction = int
Aggregate function enumerator
const ( None AggregateFunction = 0 MaxOverTime AggregateFunction = 1 AvgOverTime AggregateFunction = 2 )
Aggregation function definition
type FunctionType ¶
type FunctionType = int
Function type enumerator
const ( NoneFunction FunctionType = iota // Aggregation Function FunctionCount // Returns the number of non-null field values FuncDistinct // Returns the list of unique field values FuncIntegral // Returns the area under the curve for subsequent field values FunctionMean // Returns the arithmetic mean (average) of field values FunctionMedian // Returns the middle value from a sorted list of field values FunctionMode // Returns the most frequent value in a list of field values FunctionSpread // Returns the difference between the minimum and maximum field values FunctionStddev // Returns the standard deviation of field values FunctionSum // Returns the sum of field values // Selector function FunctionBottom // Returns the smallest N field values FunctionFirst // Returns the field value with the oldest timestamp FunctionLast // Returns the field value with the most recent timestamp FunctionMax // Returns the greatest field value FunctionMin // Returns the lowest field value FunctionPercentile // Returns the Nth percentile field value FunctionSample // Returns a random sample of N field values. SAMPLE() uses reservoir sampling to generate the random points FunctionTop // Returns the greatest N field values // Transformation function FuncDerivative // Returns the rate of change between subsequent field values )
type Option ¶
type Option func(*Options)
func AggregateOverTimeFunc ¶
func AggregateOverTimeFunc(f AggregateFunction) Option
type Options ¶
type Options struct { StartTime *time.Time EndTime *time.Time Timeout *time.Time StepTime *time.Duration AggregateOverTimeFunc AggregateFunction }
func NewDefaultOptions ¶
func NewDefaultOptions() Options
type QueryCondition ¶
type QueryCondition struct { StartTime *time.Time EndTime *time.Time Timeout *time.Time StepTime *time.Duration Function *Function Into *Into TimestampOrder Order WhereClause string WhereCondition []*Condition Selects []string Groups []string Limit int AggregateOverTimeFunction AggregateFunction }
QueryCondition Others query condition
func BuildQueryCondition ¶
func BuildQueryCondition(condition *Common.QueryCondition) QueryCondition
func BuildQueryConditionV1 ¶
func BuildQueryConditionV1(condition *ApiCommon.QueryCondition) *QueryCondition
func NewQueryCondition ¶ added in v0.9.166
func NewQueryCondition(days, hours, seconds, steps int) *QueryCondition
Click to show internal directories.
Click to hide internal directories.