Documentation
¶
Overview ¶
argument types. to let functions describe their inputs and outputs
Index ¶
- Variables
- func IntPositive(e *expr) error
- func IntZeroOrPositive(e *expr) error
- func IsAggFunc(e *expr) error
- func IsConsolFunc(e *expr) error
- func IsIntervalString(e *expr) error
- func IsOperator(e *expr) error
- func IsRenderTimeFormat(e *expr) error
- func IsSignedIntervalString(e *expr) error
- func NewAggregateConstructor(name string) func() GraphiteFunc
- func NewAggregateWithWildcardsConstructor(fn string) func() GraphiteFunc
- func NewCOWCycler(dm DataMap) seriescycle.SeriesCycler
- func NewConsolidateByConstructor(by string) func() GraphiteFunc
- func NewFilterSeriesConstructor(fn string, operator string) func() GraphiteFunc
- func NewGroupByNodesConstructor(groupByNode bool) func() GraphiteFunc
- func NewHighestLowestConstructor(fn string, highest bool) func() GraphiteFunc
- func NewMovingWindowParticular(name string) func() GraphiteFunc
- func NewRemoveAboveBelowPercentileConstructor(above bool) func() GraphiteFunc
- func NewRemoveAboveBelowValueConstructor(above bool) func() GraphiteFunc
- func NewSortByConstructor(fn string, reverse bool) func() GraphiteFunc
- func NonNegativePercent(e *expr) error
- func Normalize(in []models.Series, sc seriescycle.SeriesCycler) []models.Series
- func NormalizeTo(in models.Series, interval uint32, sc seriescycle.SeriesCycler) models.Series
- func NormalizeTwo(a, b models.Series, sc seriescycle.SeriesCycler) (models.Series, models.Series)
- func Parse(e string, pCtx ParseContext) (*expr, string, error)
- func ParseMany(targets []string) ([]*expr, error)
- func Pool(p *pointslicepool.PointSlicePool)
- func PositiveButNotOne(e *expr) error
- func SortSeriesWithConsolidator(series []models.Series, c consolidation.Consolidator, reverse bool)
- func WithinZeroOneInclusiveInterval(e *expr) error
- type Arg
- type ArgBool
- type ArgFloat
- type ArgIn
- type ArgInt
- type ArgInts
- type ArgQuotelessString
- type ArgRegex
- type ArgSeries
- type ArgSeriesList
- type ArgSeriesLists
- type ArgString
- type ArgStringOrInt
- type ArgStrings
- type ArgStringsOrInts
- type Context
- type DataMap
- type ErrBadArgument
- type ErrBadArgumentStr
- type ErrBadKwarg
- type ErrBadRegex
- type ErrKwargSpecifiedTwice
- type ErrUnknownFunction
- type ErrUnknownKwarg
- type FuncAbsolute
- type FuncAggregate
- type FuncAggregateWithWildcards
- type FuncAlias
- type FuncAliasByMetric
- type FuncAliasByNode
- type FuncAliasSub
- type FuncAsPercent
- type FuncConsolidateBy
- type FuncConstantLine
- type FuncCountSeries
- type FuncDerivative
- type FuncDivideSeries
- type FuncDivideSeriesLists
- type FuncFallbackSeries
- type FuncFilterSeries
- type FuncGet
- type FuncGrep
- type FuncGroup
- type FuncGroupByNodes
- type FuncGroupByTags
- type FuncHighestLowest
- type FuncIntegral
- type FuncInvert
- type FuncIsNonNull
- type FuncKeepLastValue
- type FuncLinearRegression
- type FuncLog
- type FuncMinMax
- type FuncMovingWindow
- type FuncNonNegativeDerivative
- type FuncOffset
- type FuncOffsetToZero
- type FuncPerSecond
- type FuncRemoveAboveBelowPercentile
- type FuncRemoveAboveBelowValue
- type FuncRemoveEmptySeries
- type FuncRemoveZeroSeries
- type FuncRound
- type FuncScale
- type FuncScaleToSeconds
- type FuncSmartSummarize
- type FuncSortBy
- type FuncSortByName
- type FuncSubstr
- type FuncSummarize
- type FuncTimeShift
- type FuncTransformNull
- type FuncUnique
- type GraphiteFunc
- func NewAbsolute() GraphiteFunc
- func NewAggregate() GraphiteFunc
- func NewAggregateWithWildcards() GraphiteFunc
- func NewAlias() GraphiteFunc
- func NewAliasByMetric() GraphiteFunc
- func NewAliasByNode() GraphiteFunc
- func NewAliasSub() GraphiteFunc
- func NewAsPercent() GraphiteFunc
- func NewConsolidateBy() GraphiteFunc
- func NewConstantLine() GraphiteFunc
- func NewCountSeries() GraphiteFunc
- func NewDerivative() GraphiteFunc
- func NewDivideSeries() GraphiteFunc
- func NewDivideSeriesLists() GraphiteFunc
- func NewExclude() GraphiteFunc
- func NewFallbackSeries() GraphiteFunc
- func NewFilterSeries() GraphiteFunc
- func NewGet(req Req) GraphiteFunc
- func NewGrep() GraphiteFunc
- func NewGroup() GraphiteFunc
- func NewGroupByTags() GraphiteFunc
- func NewIntegral() GraphiteFunc
- func NewInvert() GraphiteFunc
- func NewIsNonNull() GraphiteFunc
- func NewKeepLastValue() GraphiteFunc
- func NewLinearRegression() GraphiteFunc
- func NewLog() GraphiteFunc
- func NewMinMax() GraphiteFunc
- func NewMovingWindowGeneric() GraphiteFunc
- func NewNonNegativeDerivative() GraphiteFunc
- func NewOffset() GraphiteFunc
- func NewOffsetToZero() GraphiteFunc
- func NewPerSecond() GraphiteFunc
- func NewRemoveEmptySeries() GraphiteFunc
- func NewRemoveZeroSeries() GraphiteFunc
- func NewRound() GraphiteFunc
- func NewScale() GraphiteFunc
- func NewScaleToSeconds() GraphiteFunc
- func NewSmartSummarize() GraphiteFunc
- func NewSortByName() GraphiteFunc
- func NewSubstr() GraphiteFunc
- func NewSummarize() GraphiteFunc
- func NewTimeShift() GraphiteFunc
- func NewTransformNull() GraphiteFunc
- func NewUnique() GraphiteFunc
- type MetricRequest
- type Optimizations
- type ParseContext
- type Plan
- type Req
- type ScoredSeries
- type Validator
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingArg = errors.NewBadRequest("argument missing") ErrTooManyArg = errors.NewBadRequest("too many arguments") ErrMissingTimeseries = errors.NewBadRequest("missing time series argument") ErrWildcardNotAllowed = errors.NewBadRequest("found wildcard where series expected") ErrMissingExpr = errors.NewBadRequest("missing expression") ErrMissingComma = errors.NewBadRequest("missing comma") ErrMissingQuote = errors.NewBadRequest("missing quote") ErrUnexpectedCharacter = errors.NewBadRequest("unexpected character") ErrIllegalCharacter = errors.NewBadRequest("illegal character for function name") ErrExpectingPipeFunc = errors.NewBadRequest("pipe symbol must be followed by function call") ErrIncompleteCall = errors.NewBadRequest("incomplete function call") )
var ErrIntPositive = errors.NewBadRequest("integer must be positive")
var ErrIntZeroOrPositive = errors.NewBadRequest("integer must be zero or positive")
var ErrInvalidAggFunc = errors.NewBadRequest("Invalid aggregation func")
var ErrNonNegativePercent = errors.NewBadRequest("The requested percent is required to be greater than 0")
var ErrPositiveNotOne = errors.NewBadRequest("value must be positive and not equal to one")
var ErrWithinZeroOneInclusiveInterval = errors.NewBadRequest("value must lie within interval [0,1]")
Functions ¶
func IntPositive ¶
func IntPositive(e *expr) error
IntPositive validates whether an int is positive (greater than zero)
func IntZeroOrPositive ¶
func IntZeroOrPositive(e *expr) error
IntZeroOrPositive validates whether an int is at least 0. This is mostly used for functions which take a (series) node argument
func IsConsolFunc ¶
func IsConsolFunc(e *expr) error
func IsIntervalString ¶
func IsIntervalString(e *expr) error
func IsOperator ¶
func IsOperator(e *expr) error
func IsSignedIntervalString ¶
func IsSignedIntervalString(e *expr) error
func NewAggregateConstructor ¶
func NewAggregateConstructor(name string) func() GraphiteFunc
NewAggregateConstructor takes an agg string and returns a constructor function
func NewAggregateWithWildcardsConstructor ¶
func NewAggregateWithWildcardsConstructor(fn string) func() GraphiteFunc
func NewCOWCycler ¶
func NewCOWCycler(dm DataMap) seriescycle.SeriesCycler
NewCOW returns a SeriesCycler tailored towards COW scoped to a user request * newly provisioned series go into the datamap, such that the datamap can reclaim them when the request finishes * discarded series are left alone (not recycled, because they may be read elsewhere) (keeping this in expr to keep calls from expr code short, and avoid import cycle)
func NewConsolidateByConstructor ¶
func NewConsolidateByConstructor(by string) func() GraphiteFunc
func NewFilterSeriesConstructor ¶
func NewFilterSeriesConstructor(fn string, operator string) func() GraphiteFunc
func NewGroupByNodesConstructor ¶
func NewGroupByNodesConstructor(groupByNode bool) func() GraphiteFunc
func NewHighestLowestConstructor ¶
func NewHighestLowestConstructor(fn string, highest bool) func() GraphiteFunc
func NewMovingWindowParticular ¶
func NewMovingWindowParticular(name string) func() GraphiteFunc
NewMovingWindowParticular constructs a known, particular function (movingAverage, movingMax, etc)
func NewRemoveAboveBelowPercentileConstructor ¶
func NewRemoveAboveBelowPercentileConstructor(above bool) func() GraphiteFunc
func NewRemoveAboveBelowValueConstructor ¶
func NewRemoveAboveBelowValueConstructor(above bool) func() GraphiteFunc
func NewSortByConstructor ¶
func NewSortByConstructor(fn string, reverse bool) func() GraphiteFunc
func NonNegativePercent ¶
func NonNegativePercent(e *expr) error
func Normalize ¶
func Normalize(in []models.Series, sc seriescycle.SeriesCycler) []models.Series
Normalize normalizes series to the same common LCM interval - if they don't already have the same interval any adjusted series gets created in a series drawn out of the pool
func NormalizeTo ¶
func NormalizeTo(in models.Series, interval uint32, sc seriescycle.SeriesCycler) models.Series
NormalizeTo normalizes the given series to the desired interval will pad front and strip from back as needed, to assure the output is canonical for the given interval the following MUST be true when calling this: * interval > in.Interval * interval % in.Interval == 0 the adjusted series gets created in a series drawn out of the pool
func NormalizeTwo ¶
func NormalizeTwo(a, b models.Series, sc seriescycle.SeriesCycler) (models.Series, models.Series)
func Parse ¶
func Parse(e string, pCtx ParseContext) (*expr, string, error)
Parses an expression string and turns it into an expression also returns any leftover data that could not be parsed
func ParseMany ¶
ParseMany parses a slice of strings into a slice of expressions (recursively) not included: validation that requested functions exist, correct args are passed, etc.
func Pool ¶
func Pool(p *pointslicepool.PointSlicePool)
Pool tells the expr library which pool to use for temporary []schema.Point this lets the expr package effectively create and drop point slices as needed it is recommended you use the same pool in your application, e.g. to get slices when loading the initial data, and to return the buffers back to the pool once the output from this package's processing is no longer needed.
func PositiveButNotOne ¶
func PositiveButNotOne(e *expr) error
func SortSeriesWithConsolidator ¶
func SortSeriesWithConsolidator(series []models.Series, c consolidation.Consolidator, reverse bool)
func WithinZeroOneInclusiveInterval ¶
func WithinZeroOneInclusiveInterval(e *expr) error
Types ¶
type Arg ¶
Arg is an argument to a GraphiteFunc note how every implementation has a val property. this property should point to value accessible to the function. the value will be set up by the planner; it assures that by the time Func.Exec() is called, the function has access to all needed inputs, whether simple values, or in the case of ArgSeries* inputs other functions to call which will feed it data.
type ArgFloat ¶
type ArgFloat struct {
// contains filtered or unexported fields
}
floating point number; potentially with decimals
type ArgIn ¶
type ArgIn struct {
// contains filtered or unexported fields
}
ArgIn is a special type that allows one of multiple arguments
type ArgInt ¶
type ArgInt struct {
// contains filtered or unexported fields
}
ArgInt is a number without decimals
type ArgInts ¶
type ArgInts struct {
// contains filtered or unexported fields
}
ArgInts represents one or more numbers without decimals
type ArgQuotelessString ¶
type ArgQuotelessString struct {
// contains filtered or unexported fields
}
When an argument is a special value without quotes (such as None or INF) This should NOT be used together with ArgSeries, ArgSeriesList, ArgSeriesLists inside an ArgIn as that causes ambiguity
func (ArgQuotelessString) Key ¶
func (a ArgQuotelessString) Key() string
func (ArgQuotelessString) Optional ¶
func (a ArgQuotelessString) Optional() bool
type ArgRegex ¶
type ArgRegex struct {
// contains filtered or unexported fields
}
like string, but should result in a regex
type ArgSeries ¶
type ArgSeries struct {
// contains filtered or unexported fields
}
ArgSeries is a single series argument not generally used as input since graphite functions typically take multiple series as input but is useful to describe output
type ArgSeriesList ¶
type ArgSeriesList struct {
// contains filtered or unexported fields
}
ArgSeriesList is a list of series argument, it can be 0..N series
func (ArgSeriesList) Key ¶
func (a ArgSeriesList) Key() string
func (ArgSeriesList) Optional ¶
func (a ArgSeriesList) Optional() bool
type ArgSeriesLists ¶
type ArgSeriesLists struct {
// contains filtered or unexported fields
}
ArgSeriesLists represents one or more lists of series inputs.
func (ArgSeriesLists) Key ¶
func (a ArgSeriesLists) Key() string
func (ArgSeriesLists) Optional ¶
func (a ArgSeriesLists) Optional() bool
type ArgStringOrInt ¶
type ArgStringOrInt struct {
// contains filtered or unexported fields
}
mixed string or int
func (ArgStringOrInt) Key ¶
func (a ArgStringOrInt) Key() string
func (ArgStringOrInt) Optional ¶
func (a ArgStringOrInt) Optional() bool
type ArgStrings ¶
type ArgStrings struct {
// contains filtered or unexported fields
}
ArgStrings represents one or more strings
func (ArgStrings) Key ¶
func (a ArgStrings) Key() string
func (ArgStrings) Optional ¶
func (a ArgStrings) Optional() bool
type ArgStringsOrInts ¶
type ArgStringsOrInts struct {
// contains filtered or unexported fields
}
Array of mixed strings or ints
func (ArgStringsOrInts) Key ¶
func (a ArgStringsOrInts) Key() string
func (ArgStringsOrInts) Optional ¶
func (a ArgStringsOrInts) Optional() bool
type Context ¶
type Context struct {
PNGroup models.PNGroup // pre-normalization group. if the data can be safely pre-normalized
MDP uint32 // if we can MDP-optimize, reflects runtime consolidation MaxDataPoints. 0 otherwise
// contains filtered or unexported fields
}
Context describes a series timeframe and consolidator
type DataMap ¶
Datamap contains all series to feed into the processing chain or generated therein: * fetched series, grouped by their expr.Req, such that expr.FuncGet can find the data it needs and feed it into subsequent expr.GraphiteFunc functions * additional series generated while handling the request (e.g. function processing, normalization), keyed by an empty expr.Req (such that can't be mistakenly picked up by FuncGet) all of these series will need to be returned to the pool once we're done with all processing and have generated our response body by calling Clean() eventually we'd like to be able to reuse intermediately computed data. e.g. queries like target=movingAvg(sum(foo), 10)&target=sum(foo) but for now we don't support this
func NewDataMap ¶
func NewDataMap() DataMap
func (DataMap) CheckForOverlappingPoints ¶
CheckForOverlappingPoints runs through all series in the pool and makes sure there are no series that are overlapping (otherwise returning them would cause issues) This is not efficient and should probably only be called from tests
type ErrBadArgument ¶
type ErrBadArgument struct {
// contains filtered or unexported fields
}
func (ErrBadArgument) Error ¶
func (e ErrBadArgument) Error() string
func (ErrBadArgument) HTTPStatusCode ¶
func (e ErrBadArgument) HTTPStatusCode() int
type ErrBadArgumentStr ¶
type ErrBadArgumentStr struct {
// contains filtered or unexported fields
}
func (ErrBadArgumentStr) Error ¶
func (e ErrBadArgumentStr) Error() string
func (ErrBadArgumentStr) HTTPStatusCode ¶
func (e ErrBadArgumentStr) HTTPStatusCode() int
type ErrBadKwarg ¶
type ErrBadKwarg struct {
// contains filtered or unexported fields
}
func (ErrBadKwarg) Error ¶
func (e ErrBadKwarg) Error() string
func (ErrBadKwarg) HTTPStatusCode ¶
func (e ErrBadKwarg) HTTPStatusCode() int
type ErrBadRegex ¶
type ErrBadRegex struct {
// contains filtered or unexported fields
}
func (ErrBadRegex) HTTPStatusCode ¶
func (e ErrBadRegex) HTTPStatusCode() int
type ErrKwargSpecifiedTwice ¶
type ErrKwargSpecifiedTwice struct {
// contains filtered or unexported fields
}
func (ErrKwargSpecifiedTwice) Error ¶
func (e ErrKwargSpecifiedTwice) Error() string
func (ErrKwargSpecifiedTwice) HTTPStatusCode ¶
func (e ErrKwargSpecifiedTwice) HTTPStatusCode() int
type ErrUnknownFunction ¶
type ErrUnknownFunction string
func (ErrUnknownFunction) Error ¶
func (e ErrUnknownFunction) Error() string
func (ErrUnknownFunction) HTTPStatusCode ¶
func (e ErrUnknownFunction) HTTPStatusCode() int
type ErrUnknownKwarg ¶
type ErrUnknownKwarg struct {
// contains filtered or unexported fields
}
func (ErrUnknownKwarg) Error ¶
func (e ErrUnknownKwarg) Error() string
func (ErrUnknownKwarg) HTTPStatusCode ¶
func (e ErrUnknownKwarg) HTTPStatusCode() int
type FuncAbsolute ¶
type FuncAbsolute struct {
// contains filtered or unexported fields
}
func (*FuncAbsolute) Context ¶
func (s *FuncAbsolute) Context(context Context) Context
func (*FuncAbsolute) Signature ¶
func (s *FuncAbsolute) Signature() ([]Arg, []Arg)
type FuncAggregate ¶
type FuncAggregate struct {
// contains filtered or unexported fields
}
func (*FuncAggregate) Context ¶
func (s *FuncAggregate) Context(context Context) Context
func (*FuncAggregate) Signature ¶
func (s *FuncAggregate) Signature() ([]Arg, []Arg)
type FuncAggregateWithWildcards ¶
type FuncAggregateWithWildcards struct {
// contains filtered or unexported fields
}
func (*FuncAggregateWithWildcards) Context ¶
func (s *FuncAggregateWithWildcards) Context(context Context) Context
func (*FuncAggregateWithWildcards) Exec ¶
func (s *FuncAggregateWithWildcards) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncAggregateWithWildcards) Signature ¶
func (s *FuncAggregateWithWildcards) Signature() ([]Arg, []Arg)
type FuncAliasByMetric ¶
type FuncAliasByMetric struct {
// contains filtered or unexported fields
}
func (*FuncAliasByMetric) Context ¶
func (s *FuncAliasByMetric) Context(context Context) Context
func (*FuncAliasByMetric) Exec ¶
func (s *FuncAliasByMetric) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncAliasByMetric) Signature ¶
func (s *FuncAliasByMetric) Signature() ([]Arg, []Arg)
type FuncAliasByNode ¶
type FuncAliasByNode struct {
// contains filtered or unexported fields
}
func (*FuncAliasByNode) Context ¶
func (s *FuncAliasByNode) Context(context Context) Context
func (*FuncAliasByNode) Exec ¶
func (s *FuncAliasByNode) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncAliasByNode) Signature ¶
func (s *FuncAliasByNode) Signature() ([]Arg, []Arg)
type FuncAliasSub ¶
type FuncAliasSub struct {
// contains filtered or unexported fields
}
func (*FuncAliasSub) Context ¶
func (s *FuncAliasSub) Context(context Context) Context
func (*FuncAliasSub) Signature ¶
func (s *FuncAliasSub) Signature() ([]Arg, []Arg)
type FuncAsPercent ¶
type FuncAsPercent struct {
// contains filtered or unexported fields
}
func (*FuncAsPercent) Context ¶
func (s *FuncAsPercent) Context(context Context) Context
func (*FuncAsPercent) Signature ¶
func (s *FuncAsPercent) Signature() ([]Arg, []Arg)
type FuncConsolidateBy ¶
type FuncConsolidateBy struct {
// contains filtered or unexported fields
}
func (*FuncConsolidateBy) Context ¶
func (s *FuncConsolidateBy) Context(context Context) Context
func (*FuncConsolidateBy) Exec ¶
func (s *FuncConsolidateBy) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncConsolidateBy) Signature ¶
func (s *FuncConsolidateBy) Signature() ([]Arg, []Arg)
type FuncConstantLine ¶
type FuncConstantLine struct {
// contains filtered or unexported fields
}
func (*FuncConstantLine) Context ¶
func (s *FuncConstantLine) Context(context Context) Context
func (*FuncConstantLine) Exec ¶
func (s *FuncConstantLine) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncConstantLine) Signature ¶
func (s *FuncConstantLine) Signature() ([]Arg, []Arg)
type FuncCountSeries ¶
type FuncCountSeries struct {
// contains filtered or unexported fields
}
func (*FuncCountSeries) Context ¶
func (s *FuncCountSeries) Context(context Context) Context
func (*FuncCountSeries) Exec ¶
func (s *FuncCountSeries) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncCountSeries) Signature ¶
func (s *FuncCountSeries) Signature() ([]Arg, []Arg)
type FuncDerivative ¶
type FuncDerivative struct {
// contains filtered or unexported fields
}
func (*FuncDerivative) Context ¶
func (s *FuncDerivative) Context(context Context) Context
func (*FuncDerivative) Exec ¶
func (s *FuncDerivative) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncDerivative) Signature ¶
func (s *FuncDerivative) Signature() ([]Arg, []Arg)
type FuncDivideSeries ¶
type FuncDivideSeries struct {
// contains filtered or unexported fields
}
FuncDivideSeries divides 1-N dividend series by 1 dividend series
func (*FuncDivideSeries) Context ¶
func (s *FuncDivideSeries) Context(context Context) Context
func (*FuncDivideSeries) Exec ¶
func (s *FuncDivideSeries) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncDivideSeries) Signature ¶
func (s *FuncDivideSeries) Signature() ([]Arg, []Arg)
type FuncDivideSeriesLists ¶
type FuncDivideSeriesLists struct {
// contains filtered or unexported fields
}
FuncDivideSeriesLists divides dividends by divisors, pairwise
func (*FuncDivideSeriesLists) Context ¶
func (s *FuncDivideSeriesLists) Context(context Context) Context
func (*FuncDivideSeriesLists) Exec ¶
func (s *FuncDivideSeriesLists) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncDivideSeriesLists) Signature ¶
func (s *FuncDivideSeriesLists) Signature() ([]Arg, []Arg)
type FuncFallbackSeries ¶
type FuncFallbackSeries struct {
// contains filtered or unexported fields
}
func (*FuncFallbackSeries) Context ¶
func (s *FuncFallbackSeries) Context(context Context) Context
func (*FuncFallbackSeries) Exec ¶
func (s *FuncFallbackSeries) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncFallbackSeries) Signature ¶
func (s *FuncFallbackSeries) Signature() ([]Arg, []Arg)
type FuncFilterSeries ¶
type FuncFilterSeries struct {
// contains filtered or unexported fields
}
func (*FuncFilterSeries) Context ¶
func (s *FuncFilterSeries) Context(context Context) Context
func (*FuncFilterSeries) Exec ¶
func (s *FuncFilterSeries) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncFilterSeries) Signature ¶
func (s *FuncFilterSeries) Signature() ([]Arg, []Arg)
type FuncGet ¶
type FuncGet struct {
// contains filtered or unexported fields
}
internal function just for getting data
type FuncGroupByNodes ¶
type FuncGroupByNodes struct {
// contains filtered or unexported fields
}
func (*FuncGroupByNodes) Context ¶
func (s *FuncGroupByNodes) Context(context Context) Context
func (*FuncGroupByNodes) Exec ¶
func (s *FuncGroupByNodes) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncGroupByNodes) Signature ¶
func (s *FuncGroupByNodes) Signature() ([]Arg, []Arg)
type FuncGroupByTags ¶
type FuncGroupByTags struct {
// contains filtered or unexported fields
}
func (*FuncGroupByTags) Context ¶
func (s *FuncGroupByTags) Context(context Context) Context
func (*FuncGroupByTags) Exec ¶
func (s *FuncGroupByTags) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncGroupByTags) Signature ¶
func (s *FuncGroupByTags) Signature() ([]Arg, []Arg)
type FuncHighestLowest ¶
type FuncHighestLowest struct {
// contains filtered or unexported fields
}
func (*FuncHighestLowest) Context ¶
func (s *FuncHighestLowest) Context(context Context) Context
func (*FuncHighestLowest) Exec ¶
func (s *FuncHighestLowest) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncHighestLowest) Signature ¶
func (s *FuncHighestLowest) Signature() ([]Arg, []Arg)
type FuncIntegral ¶
type FuncIntegral struct {
// contains filtered or unexported fields
}
func (*FuncIntegral) Context ¶
func (s *FuncIntegral) Context(context Context) Context
func (*FuncIntegral) Signature ¶
func (s *FuncIntegral) Signature() ([]Arg, []Arg)
type FuncInvert ¶
type FuncInvert struct {
// contains filtered or unexported fields
}
func (*FuncInvert) Context ¶
func (s *FuncInvert) Context(context Context) Context
func (*FuncInvert) Signature ¶
func (s *FuncInvert) Signature() ([]Arg, []Arg)
type FuncIsNonNull ¶
type FuncIsNonNull struct {
// contains filtered or unexported fields
}
func (*FuncIsNonNull) Context ¶
func (s *FuncIsNonNull) Context(context Context) Context
func (*FuncIsNonNull) Signature ¶
func (s *FuncIsNonNull) Signature() ([]Arg, []Arg)
type FuncKeepLastValue ¶
type FuncKeepLastValue struct {
// contains filtered or unexported fields
}
func (*FuncKeepLastValue) Context ¶
func (s *FuncKeepLastValue) Context(context Context) Context
func (*FuncKeepLastValue) Exec ¶
func (s *FuncKeepLastValue) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncKeepLastValue) Signature ¶
func (s *FuncKeepLastValue) Signature() ([]Arg, []Arg)
type FuncLinearRegression ¶
type FuncLinearRegression struct {
// contains filtered or unexported fields
}
func (*FuncLinearRegression) Context ¶
func (s *FuncLinearRegression) Context(context Context) Context
func (*FuncLinearRegression) Exec ¶
func (s *FuncLinearRegression) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncLinearRegression) Signature ¶
func (s *FuncLinearRegression) Signature() ([]Arg, []Arg)
type FuncMinMax ¶
type FuncMinMax struct {
// contains filtered or unexported fields
}
func (*FuncMinMax) Context ¶
func (s *FuncMinMax) Context(context Context) Context
func (*FuncMinMax) Signature ¶
func (s *FuncMinMax) Signature() ([]Arg, []Arg)
type FuncMovingWindow ¶
type FuncMovingWindow struct {
// contains filtered or unexported fields
}
func (*FuncMovingWindow) Context ¶
func (s *FuncMovingWindow) Context(context Context) Context
func (*FuncMovingWindow) Exec ¶
func (s *FuncMovingWindow) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncMovingWindow) Signature ¶
func (s *FuncMovingWindow) Signature() ([]Arg, []Arg)
type FuncNonNegativeDerivative ¶
type FuncNonNegativeDerivative struct {
// contains filtered or unexported fields
}
func (*FuncNonNegativeDerivative) Context ¶
func (s *FuncNonNegativeDerivative) Context(context Context) Context
func (*FuncNonNegativeDerivative) Exec ¶
func (s *FuncNonNegativeDerivative) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncNonNegativeDerivative) Signature ¶
func (s *FuncNonNegativeDerivative) Signature() ([]Arg, []Arg)
type FuncOffset ¶
type FuncOffset struct {
// contains filtered or unexported fields
}
func (*FuncOffset) Context ¶
func (s *FuncOffset) Context(context Context) Context
func (*FuncOffset) Signature ¶
func (s *FuncOffset) Signature() ([]Arg, []Arg)
type FuncOffsetToZero ¶
type FuncOffsetToZero struct {
// contains filtered or unexported fields
}
func (*FuncOffsetToZero) Context ¶
func (s *FuncOffsetToZero) Context(context Context) Context
func (*FuncOffsetToZero) Exec ¶
func (s *FuncOffsetToZero) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncOffsetToZero) Signature ¶
func (s *FuncOffsetToZero) Signature() ([]Arg, []Arg)
type FuncPerSecond ¶
type FuncPerSecond struct {
// contains filtered or unexported fields
}
func (*FuncPerSecond) Context ¶
func (s *FuncPerSecond) Context(context Context) Context
func (*FuncPerSecond) Signature ¶
func (s *FuncPerSecond) Signature() ([]Arg, []Arg)
type FuncRemoveAboveBelowPercentile ¶
type FuncRemoveAboveBelowPercentile struct {
// contains filtered or unexported fields
}
func (*FuncRemoveAboveBelowPercentile) Context ¶
func (s *FuncRemoveAboveBelowPercentile) Context(context Context) Context
func (*FuncRemoveAboveBelowPercentile) Exec ¶
func (s *FuncRemoveAboveBelowPercentile) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncRemoveAboveBelowPercentile) Signature ¶
func (s *FuncRemoveAboveBelowPercentile) Signature() ([]Arg, []Arg)
type FuncRemoveAboveBelowValue ¶
type FuncRemoveAboveBelowValue struct {
// contains filtered or unexported fields
}
func (*FuncRemoveAboveBelowValue) Context ¶
func (s *FuncRemoveAboveBelowValue) Context(context Context) Context
func (*FuncRemoveAboveBelowValue) Exec ¶
func (s *FuncRemoveAboveBelowValue) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncRemoveAboveBelowValue) Signature ¶
func (s *FuncRemoveAboveBelowValue) Signature() ([]Arg, []Arg)
type FuncRemoveEmptySeries ¶
type FuncRemoveEmptySeries struct {
// contains filtered or unexported fields
}
func (*FuncRemoveEmptySeries) Context ¶
func (s *FuncRemoveEmptySeries) Context(context Context) Context
func (*FuncRemoveEmptySeries) Exec ¶
func (s *FuncRemoveEmptySeries) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncRemoveEmptySeries) Signature ¶
func (s *FuncRemoveEmptySeries) Signature() ([]Arg, []Arg)
type FuncRemoveZeroSeries ¶
type FuncRemoveZeroSeries struct {
// contains filtered or unexported fields
}
func (*FuncRemoveZeroSeries) Context ¶
func (s *FuncRemoveZeroSeries) Context(context Context) Context
func (*FuncRemoveZeroSeries) Exec ¶
func (s *FuncRemoveZeroSeries) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncRemoveZeroSeries) Signature ¶
func (s *FuncRemoveZeroSeries) Signature() ([]Arg, []Arg)
type FuncScaleToSeconds ¶
type FuncScaleToSeconds struct {
// contains filtered or unexported fields
}
func (*FuncScaleToSeconds) Context ¶
func (s *FuncScaleToSeconds) Context(context Context) Context
func (*FuncScaleToSeconds) Exec ¶
func (s *FuncScaleToSeconds) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncScaleToSeconds) Signature ¶
func (s *FuncScaleToSeconds) Signature() ([]Arg, []Arg)
type FuncSmartSummarize ¶
type FuncSmartSummarize struct {
// contains filtered or unexported fields
}
func (*FuncSmartSummarize) Context ¶
func (s *FuncSmartSummarize) Context(context Context) Context
func (*FuncSmartSummarize) Exec ¶
func (s *FuncSmartSummarize) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncSmartSummarize) Signature ¶
func (s *FuncSmartSummarize) Signature() ([]Arg, []Arg)
type FuncSortBy ¶
type FuncSortBy struct {
// contains filtered or unexported fields
}
func (*FuncSortBy) Context ¶
func (s *FuncSortBy) Context(context Context) Context
func (*FuncSortBy) Signature ¶
func (s *FuncSortBy) Signature() ([]Arg, []Arg)
type FuncSortByName ¶
type FuncSortByName struct {
// contains filtered or unexported fields
}
func (*FuncSortByName) Context ¶
func (s *FuncSortByName) Context(context Context) Context
func (*FuncSortByName) Exec ¶
func (s *FuncSortByName) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncSortByName) Signature ¶
func (s *FuncSortByName) Signature() ([]Arg, []Arg)
type FuncSubstr ¶
type FuncSubstr struct {
// contains filtered or unexported fields
}
func (*FuncSubstr) Context ¶
func (s *FuncSubstr) Context(context Context) Context
func (*FuncSubstr) Signature ¶
func (s *FuncSubstr) Signature() ([]Arg, []Arg)
type FuncSummarize ¶
type FuncSummarize struct {
// contains filtered or unexported fields
}
func (*FuncSummarize) Context ¶
func (s *FuncSummarize) Context(context Context) Context
func (*FuncSummarize) Signature ¶
func (s *FuncSummarize) Signature() ([]Arg, []Arg)
type FuncTimeShift ¶
type FuncTimeShift struct {
// contains filtered or unexported fields
}
func (*FuncTimeShift) Context ¶
func (s *FuncTimeShift) Context(context Context) Context
func (*FuncTimeShift) Signature ¶
func (s *FuncTimeShift) Signature() ([]Arg, []Arg)
type FuncTransformNull ¶
type FuncTransformNull struct {
// contains filtered or unexported fields
}
func (*FuncTransformNull) Context ¶
func (s *FuncTransformNull) Context(context Context) Context
func (*FuncTransformNull) Exec ¶
func (s *FuncTransformNull) Exec(dataMap DataMap) ([]models.Series, error)
func (*FuncTransformNull) Signature ¶
func (s *FuncTransformNull) Signature() ([]Arg, []Arg)
type FuncUnique ¶
type FuncUnique struct {
// contains filtered or unexported fields
}
func (*FuncUnique) Context ¶
func (s *FuncUnique) Context(context Context) Context
func (*FuncUnique) Signature ¶
func (s *FuncUnique) Signature() ([]Arg, []Arg)
type GraphiteFunc ¶
type GraphiteFunc interface {
// Signature declares input and output arguments (return values)
// input args can be optional in which case they can be specified positionally or via keys if you want to specify params that come after un-specified optional params
// the val pointers of each input Arg should point to a location accessible to the function,
// so that the planner can set up the inputs for your function based on user input.
// NewPlan() will only create the plan if the expressions it parsed correspond to the signatures provided by the function
Signature() ([]Arg, []Arg)
// Context allows a func to alter the context that will be passed down the expression tree.
// this function will be called after validating and setting up all non-series and non-serieslist parameters.
// (as typically, context alterations require integer/string/bool/etc parameters, and shall affect series[list] parameters)
// examples:
// * movingAverage(foo,5min) -> the 5min arg will be parsed, so we can request 5min of earlier data, which will affect the request for foo.
// * consolidateBy(bar, "sum") -> the "sum" arg will be parsed, so we can pass on the fact that bar needs to be sum-consolidated
Context(c Context) Context
// Exec executes the function. the function should call any input functions, do its processing, and return output.
// IMPORTANT: for performance and correctness, functions should
// * not modify slices of points that they get from their inputs
// * use the pool to get new slices in which to store any new/modified dat
// * add the newly created slices into the dataMap so they can be reclaimed after the output is consumed
// * not modify other properties on its input series, such as Tags map or Meta
Exec(dataMap DataMap) ([]models.Series, error)
}
GraphiteFunc defines a graphite processing function
func NewAbsolute ¶
func NewAbsolute() GraphiteFunc
func NewAggregate ¶
func NewAggregate() GraphiteFunc
func NewAggregateWithWildcards ¶
func NewAggregateWithWildcards() GraphiteFunc
func NewAlias ¶
func NewAlias() GraphiteFunc
func NewAliasByMetric ¶
func NewAliasByMetric() GraphiteFunc
func NewAliasByNode ¶
func NewAliasByNode() GraphiteFunc
func NewAliasSub ¶
func NewAliasSub() GraphiteFunc
func NewAsPercent ¶
func NewAsPercent() GraphiteFunc
func NewConsolidateBy ¶
func NewConsolidateBy() GraphiteFunc
func NewConstantLine ¶
func NewConstantLine() GraphiteFunc
func NewCountSeries ¶
func NewCountSeries() GraphiteFunc
func NewDerivative ¶
func NewDerivative() GraphiteFunc
func NewDivideSeries ¶
func NewDivideSeries() GraphiteFunc
func NewDivideSeriesLists ¶
func NewDivideSeriesLists() GraphiteFunc
func NewExclude ¶
func NewExclude() GraphiteFunc
func NewFallbackSeries ¶
func NewFallbackSeries() GraphiteFunc
func NewFilterSeries ¶
func NewFilterSeries() GraphiteFunc
func NewGet ¶
func NewGet(req Req) GraphiteFunc
func NewGrep ¶
func NewGrep() GraphiteFunc
func NewGroup ¶
func NewGroup() GraphiteFunc
func NewGroupByTags ¶
func NewGroupByTags() GraphiteFunc
func NewIntegral ¶
func NewIntegral() GraphiteFunc
func NewInvert ¶
func NewInvert() GraphiteFunc
func NewIsNonNull ¶
func NewIsNonNull() GraphiteFunc
func NewKeepLastValue ¶
func NewKeepLastValue() GraphiteFunc
func NewLinearRegression ¶
func NewLinearRegression() GraphiteFunc
func NewLog ¶
func NewLog() GraphiteFunc
func NewMinMax ¶
func NewMinMax() GraphiteFunc
func NewMovingWindowGeneric ¶
func NewMovingWindowGeneric() GraphiteFunc
NewMovingWindowGeneric constructs a generic movingWindow function
func NewNonNegativeDerivative ¶
func NewNonNegativeDerivative() GraphiteFunc
func NewOffset ¶
func NewOffset() GraphiteFunc
func NewOffsetToZero ¶
func NewOffsetToZero() GraphiteFunc
func NewPerSecond ¶
func NewPerSecond() GraphiteFunc
func NewRemoveEmptySeries ¶
func NewRemoveEmptySeries() GraphiteFunc
func NewRemoveZeroSeries ¶
func NewRemoveZeroSeries() GraphiteFunc
func NewRound ¶
func NewRound() GraphiteFunc
func NewScale ¶
func NewScale() GraphiteFunc
func NewScaleToSeconds ¶
func NewScaleToSeconds() GraphiteFunc
func NewSmartSummarize ¶
func NewSmartSummarize() GraphiteFunc
func NewSortByName ¶
func NewSortByName() GraphiteFunc
func NewSubstr ¶
func NewSubstr() GraphiteFunc
func NewSummarize ¶
func NewSummarize() GraphiteFunc
func NewTimeShift ¶
func NewTimeShift() GraphiteFunc
func NewTransformNull ¶
func NewTransformNull() GraphiteFunc
func NewUnique ¶
func NewUnique() GraphiteFunc
type MetricRequest ¶
type Optimizations ¶
func (Optimizations) ApplyUserPrefs ¶
func (o Optimizations) ApplyUserPrefs(s string) (Optimizations, error)
type ParseContext ¶
type ParseContext struct {
// Piped means the expression to be parsed is known to receive a piped
// input.
Piped bool
// CanParseAsNumber means the expression returned from Parse() can be a
// number. Only a full, non-piped argument for a function call can be
// parsed as a number.
// For example, given the string "funcA(1 | funcB(2), 3)":
// "1" should not be parsed as a number. While it is in the first funcA
// argument, it is not the entire argument (there are additional
// characters "| funcB(2)" before the comma indicating the end of one
// argument). While "1" could also be seen as an argument to funcB, a
// number cannot be the input to a pipe. It should instead be parsed as a
// metric named "1".
// "2" is a full argument for funcB, so it should be parsed as a number.
// "3" is a full argument for funcA, so it should be parsed as a number.
CanParseAsNumber bool
}
ParseContext includes contextual information that affects how the current expression is parsed. This should only be set by internal calls.
type Plan ¶
type Plan struct {
Reqs []Req // data that needs to be fetched before functions can be executed
MaxDataPoints uint32
From uint32 // global request scoped from
To uint32 // global request scoped to
// contains filtered or unexported fields
}
func NewPlan ¶
func NewPlan(exprs []*expr, from, to, mdp uint32, stable bool, optimizations Optimizations) (Plan, error)
NewPlan validates the expressions and comes up with the initial (potentially non-optimal) execution plan which is just a list of requests and the expressions. traverse tree and as we go down: * make sure function exists * validation of arguments * allow functions to modify the Context (change data range or consolidation) * future version: allow functions to mark safe to pre-aggregate using consolidateBy or not
func (Plan) CheckedClean ¶
type Req ¶
type Req struct {
Query string // whatever was parsed as the query out of a graphite target. e.g. target=sum(foo.{b,a}r.*) -> foo.{b,a}r.* -> this will go straight to index lookup
From uint32
To uint32
Cons consolidation.Consolidator // can be 0 to mean undefined
PNGroup models.PNGroup
MDP uint32 // if we can MDP-optimize, reflects runtime consolidation MaxDataPoints. 0 otherwise.
}
Req represents a request for one/more series
func NewReq ¶
func NewReq(query string, from, to uint32, cons consolidation.Consolidator, PNGroup models.PNGroup, MDP uint32) Req
NewReq creates a new Req. pass cons=0 to leave consolidator undefined, leaving up to the caller (in graphite's case, it would cause a lookup into storage-aggregation.conf)
func NewReqFromContext ¶
func NewReqFromSerie ¶
NewReqFromSeries generates a Req back from a series a models.Series has all the properties attached to it to find out which Req it came from
type ScoredSeries ¶
type ScoredSeries struct {
// contains filtered or unexported fields
}
Source Files
¶
- cowcycler.go
- datamap.go
- expr.go
- exprtype_string.go
- func_absolute.go
- func_aggregate.go
- func_aggregatewithwildcards.go
- func_alias.go
- func_aliasbymetric.go
- func_aliasbynode.go
- func_aliassub.go
- func_aspercent.go
- func_consolidateby.go
- func_constantline.go
- func_countseries.go
- func_derivative.go
- func_divideseries.go
- func_divideserieslists.go
- func_fallbackSeries.go
- func_filterseries.go
- func_get.go
- func_grep.go
- func_group.go
- func_groupbynodes.go
- func_groupbytags.go
- func_highestlowest.go
- func_integral.go
- func_invert.go
- func_isnonnull.go
- func_keeplastvalue.go
- func_linearregression.go
- func_log.go
- func_minmax.go
- func_movingwindow.go
- func_nonnegativederivative.go
- func_offset.go
- func_offsettozero.go
- func_persecond.go
- func_removeabovebelowpercentile.go
- func_removeabovebelowvalue.go
- func_removeemptyseries.go
- func_removezeroseries.go
- func_round.go
- func_scale.go
- func_scaletoseconds.go
- func_smartsummarize.go
- func_sortby.go
- func_sortbyname.go
- func_substr.go
- func_summarize.go
- func_timeshift.go
- func_transformnull.go
- func_unique.go
- funcs.go
- normalize.go
- parse.go
- plan.go
- pool.go
- seriesaggregators.go
- test.go
- types.go
- validator.go
- xfilesfactor.go