metrictank: github.com/grafana/metrictank/expr Index | Files | Directories

package expr

import "github.com/grafana/metrictank/expr"

argument types. to let functions describe their inputs and outputs

Index

Package Files

datamap.go expr.go exprtype_string.go func_absolute.go func_aggregate.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_minmax.go func_movingaverage.go func_nonnegativederivative.go func_offset.go func_persecond.go func_removeabovebelowpercentile.go func_removeabovebelowvalue.go func_removeemptyseries.go func_round.go func_scale.go func_scaletoseconds.go func_smartsummarize.go func_sortby.go func_sortbyname.go func_summarize.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

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")
)
var ErrIntPositive = errors.NewBadRequest("integer must be positive")
var ErrInvalidAggFunc = errors.NewBadRequest("Invalid aggregation func")
var ErrNonNegativePercent = errors.NewBadRequest("The requested percent is required to be greater than 0")
var ErrWithinZeroOneInclusiveInterval = errors.NewBadRequest("value must lie within interval [0,1]")

func IntPositive Uses

func IntPositive(e *expr) error

IntPositive validates whether an int is positive (greater than zero)

func IsAggFunc Uses

func IsAggFunc(e *expr) error

func IsConsolFunc Uses

func IsConsolFunc(e *expr) error

func IsIntervalString Uses

func IsIntervalString(e *expr) error

func IsOperator Uses

func IsOperator(e *expr) error

func NewAggregateConstructor Uses

func NewAggregateConstructor(name string) func() GraphiteFunc

NewAggregateConstructor takes an agg string and returns a constructor function

func NewConsolidateByConstructor Uses

func NewConsolidateByConstructor(by string) func() GraphiteFunc

func NewFilterSeriesConstructor Uses

func NewFilterSeriesConstructor(fn string, operator string) func() GraphiteFunc

func NewGroupByNodesConstructor Uses

func NewGroupByNodesConstructor(groupByNode bool) func() GraphiteFunc

func NewHighestLowestConstructor Uses

func NewHighestLowestConstructor(fn string, highest bool) func() GraphiteFunc

func NewRemoveAboveBelowPercentileConstructor Uses

func NewRemoveAboveBelowPercentileConstructor(above bool) func() GraphiteFunc

func NewRemoveAboveBelowValueConstructor Uses

func NewRemoveAboveBelowValueConstructor(above bool) func() GraphiteFunc

func NewSortByConstructor Uses

func NewSortByConstructor(fn string, reverse bool) func() GraphiteFunc

func NonNegativePercent Uses

func NonNegativePercent(e *expr) error

func Normalize Uses

func Normalize(dataMap DataMap, in []models.Series) []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 and is added to the dataMap so it can be reclaimed

func NormalizeTo Uses

func NormalizeTo(dataMap DataMap, in models.Series, interval uint32) 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

func NormalizeTwo Uses

func NormalizeTwo(dataMap DataMap, a, b models.Series) (models.Series, models.Series)

func Parse Uses

func Parse(e string) (*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 Uses

func ParseMany(targets []string) ([]*expr, error)

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 Uses

func Pool(p *sync.Pool)

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 SortSeriesWithConsolidator Uses

func SortSeriesWithConsolidator(series []models.Series, c consolidation.Consolidator, reverse bool)

func WithinZeroOneInclusiveInterval Uses

func WithinZeroOneInclusiveInterval(e *expr) error

type Arg Uses

type Arg interface {
    Key() string
    Optional() bool
}

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 ArgBool Uses

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

True or False

func (ArgBool) Key Uses

func (a ArgBool) Key() string

func (ArgBool) Optional Uses

func (a ArgBool) Optional() bool

type ArgFloat Uses

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

floating point number; potentially with decimals

func (ArgFloat) Key Uses

func (a ArgFloat) Key() string

func (ArgFloat) Optional Uses

func (a ArgFloat) Optional() bool

type ArgIn Uses

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

ArgIn is a special type that allows one of multiple arguments

func (ArgIn) Key Uses

func (a ArgIn) Key() string

func (ArgIn) Optional Uses

func (a ArgIn) Optional() bool

type ArgInt Uses

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

ArgInt is a number without decimals

func (ArgInt) Key Uses

func (a ArgInt) Key() string

func (ArgInt) Optional Uses

func (a ArgInt) Optional() bool

type ArgInts Uses

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

ArgInts represents one or more numbers without decimals

func (ArgInts) Key Uses

func (a ArgInts) Key() string

func (ArgInts) Optional Uses

func (a ArgInts) Optional() bool

type ArgQuotelessString Uses

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 Uses

func (a ArgQuotelessString) Key() string

func (ArgQuotelessString) Optional Uses

func (a ArgQuotelessString) Optional() bool

type ArgRegex Uses

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

like string, but should result in a regex

func (ArgRegex) Key Uses

func (a ArgRegex) Key() string

func (ArgRegex) Optional Uses

func (a ArgRegex) Optional() bool

type ArgSeries Uses

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

func (ArgSeries) Key Uses

func (a ArgSeries) Key() string

func (ArgSeries) Optional Uses

func (a ArgSeries) Optional() bool

type ArgSeriesList Uses

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

ArgSeriesList is a list of series argument, it can be 0..N series

func (ArgSeriesList) Key Uses

func (a ArgSeriesList) Key() string

func (ArgSeriesList) Optional Uses

func (a ArgSeriesList) Optional() bool

type ArgSeriesLists Uses

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

ArgSeriesLists represents one or more lists of series inputs.

func (ArgSeriesLists) Key Uses

func (a ArgSeriesLists) Key() string

func (ArgSeriesLists) Optional Uses

func (a ArgSeriesLists) Optional() bool

type ArgString Uses

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

string

func (ArgString) Key Uses

func (a ArgString) Key() string

func (ArgString) Optional Uses

func (a ArgString) Optional() bool

type ArgStringOrInt Uses

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

mixed string or int

func (ArgStringOrInt) Key Uses

func (a ArgStringOrInt) Key() string

func (ArgStringOrInt) Optional Uses

func (a ArgStringOrInt) Optional() bool

type ArgStrings Uses

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

ArgStrings represents one or more strings

func (ArgStrings) Key Uses

func (a ArgStrings) Key() string

func (ArgStrings) Optional Uses

func (a ArgStrings) Optional() bool

type ArgStringsOrInts Uses

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

Array of mixed strings or ints

func (ArgStringsOrInts) Key Uses

func (a ArgStringsOrInts) Key() string

func (ArgStringsOrInts) Optional Uses

func (a ArgStringsOrInts) Optional() bool

type Context Uses

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 Uses

type DataMap map[Req][]models.Series

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 Uses

func NewDataMap() DataMap

func (DataMap) Add Uses

func (dm DataMap) Add(r Req, s ...models.Series)

func (DataMap) CheckForOverlappingPoints Uses

func (dm DataMap) CheckForOverlappingPoints() error

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

func (DataMap) Clean Uses

func (dm DataMap) Clean()

Clean returns all contained pointslices back to the pool.

type ErrBadArgument Uses

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

func (ErrBadArgument) Error Uses

func (e ErrBadArgument) Error() string

func (ErrBadArgument) HTTPStatusCode Uses

func (e ErrBadArgument) HTTPStatusCode() int

type ErrBadArgumentStr Uses

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

func (ErrBadArgumentStr) Error Uses

func (e ErrBadArgumentStr) Error() string

func (ErrBadArgumentStr) HTTPStatusCode Uses

func (e ErrBadArgumentStr) HTTPStatusCode() int

type ErrBadKwarg Uses

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

func (ErrBadKwarg) Error Uses

func (e ErrBadKwarg) Error() string

func (ErrBadKwarg) HTTPStatusCode Uses

func (e ErrBadKwarg) HTTPStatusCode() int

type ErrBadRegex Uses

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

func (ErrBadRegex) HTTPStatusCode Uses

func (e ErrBadRegex) HTTPStatusCode() int

type ErrKwargSpecifiedTwice Uses

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

func (ErrKwargSpecifiedTwice) Error Uses

func (e ErrKwargSpecifiedTwice) Error() string

func (ErrKwargSpecifiedTwice) HTTPStatusCode Uses

func (e ErrKwargSpecifiedTwice) HTTPStatusCode() int

type ErrUnknownFunction Uses

type ErrUnknownFunction string

func (ErrUnknownFunction) Error Uses

func (e ErrUnknownFunction) Error() string

func (ErrUnknownFunction) HTTPStatusCode Uses

func (e ErrUnknownFunction) HTTPStatusCode() int

type ErrUnknownKwarg Uses

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

func (ErrUnknownKwarg) Error Uses

func (e ErrUnknownKwarg) Error() string

func (ErrUnknownKwarg) HTTPStatusCode Uses

func (e ErrUnknownKwarg) HTTPStatusCode() int

type FuncAbsolute Uses

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

func (*FuncAbsolute) Context Uses

func (s *FuncAbsolute) Context(context Context) Context

func (*FuncAbsolute) Exec Uses

func (s *FuncAbsolute) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAbsolute) Signature Uses

func (s *FuncAbsolute) Signature() ([]Arg, []Arg)

type FuncAggregate Uses

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

func (*FuncAggregate) Context Uses

func (s *FuncAggregate) Context(context Context) Context

func (*FuncAggregate) Exec Uses

func (s *FuncAggregate) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAggregate) Signature Uses

func (s *FuncAggregate) Signature() ([]Arg, []Arg)

type FuncAlias Uses

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

func (*FuncAlias) Context Uses

func (s *FuncAlias) Context(context Context) Context

func (*FuncAlias) Exec Uses

func (s *FuncAlias) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAlias) Signature Uses

func (s *FuncAlias) Signature() ([]Arg, []Arg)

type FuncAliasByMetric Uses

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

func (*FuncAliasByMetric) Context Uses

func (s *FuncAliasByMetric) Context(context Context) Context

func (*FuncAliasByMetric) Exec Uses

func (s *FuncAliasByMetric) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAliasByMetric) Signature Uses

func (s *FuncAliasByMetric) Signature() ([]Arg, []Arg)

type FuncAliasByNode Uses

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

func (*FuncAliasByNode) Context Uses

func (s *FuncAliasByNode) Context(context Context) Context

func (*FuncAliasByNode) Exec Uses

func (s *FuncAliasByNode) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAliasByNode) Signature Uses

func (s *FuncAliasByNode) Signature() ([]Arg, []Arg)

type FuncAliasSub Uses

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

func (*FuncAliasSub) Context Uses

func (s *FuncAliasSub) Context(context Context) Context

func (*FuncAliasSub) Exec Uses

func (s *FuncAliasSub) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAliasSub) Signature Uses

func (s *FuncAliasSub) Signature() ([]Arg, []Arg)

type FuncAsPercent Uses

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

func (*FuncAsPercent) Context Uses

func (s *FuncAsPercent) Context(context Context) Context

func (*FuncAsPercent) Exec Uses

func (s *FuncAsPercent) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncAsPercent) Signature Uses

func (s *FuncAsPercent) Signature() ([]Arg, []Arg)

type FuncConsolidateBy Uses

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

func (*FuncConsolidateBy) Context Uses

func (s *FuncConsolidateBy) Context(context Context) Context

func (*FuncConsolidateBy) Exec Uses

func (s *FuncConsolidateBy) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncConsolidateBy) Signature Uses

func (s *FuncConsolidateBy) Signature() ([]Arg, []Arg)

type FuncConstantLine Uses

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

func (*FuncConstantLine) Context Uses

func (s *FuncConstantLine) Context(context Context) Context

func (*FuncConstantLine) Exec Uses

func (s *FuncConstantLine) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncConstantLine) Signature Uses

func (s *FuncConstantLine) Signature() ([]Arg, []Arg)

type FuncCountSeries Uses

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

func (*FuncCountSeries) Context Uses

func (s *FuncCountSeries) Context(context Context) Context

func (*FuncCountSeries) Exec Uses

func (s *FuncCountSeries) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncCountSeries) Signature Uses

func (s *FuncCountSeries) Signature() ([]Arg, []Arg)

type FuncDerivative Uses

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

func (*FuncDerivative) Context Uses

func (s *FuncDerivative) Context(context Context) Context

func (*FuncDerivative) Exec Uses

func (s *FuncDerivative) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncDerivative) Signature Uses

func (s *FuncDerivative) Signature() ([]Arg, []Arg)

type FuncDivideSeries Uses

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

FuncDivideSeries divides 1-N dividend series by 1 dividend series

func (*FuncDivideSeries) Context Uses

func (s *FuncDivideSeries) Context(context Context) Context

func (*FuncDivideSeries) Exec Uses

func (s *FuncDivideSeries) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncDivideSeries) Signature Uses

func (s *FuncDivideSeries) Signature() ([]Arg, []Arg)

type FuncDivideSeriesLists Uses

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

FuncDivideSeriesLists divides dividends by divisors, pairwise

func (*FuncDivideSeriesLists) Context Uses

func (s *FuncDivideSeriesLists) Context(context Context) Context

func (*FuncDivideSeriesLists) Exec Uses

func (s *FuncDivideSeriesLists) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncDivideSeriesLists) Signature Uses

func (s *FuncDivideSeriesLists) Signature() ([]Arg, []Arg)

type FuncFallbackSeries Uses

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

func (*FuncFallbackSeries) Context Uses

func (s *FuncFallbackSeries) Context(context Context) Context

func (*FuncFallbackSeries) Exec Uses

func (s *FuncFallbackSeries) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncFallbackSeries) Signature Uses

func (s *FuncFallbackSeries) Signature() ([]Arg, []Arg)

type FuncFilterSeries Uses

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

func (*FuncFilterSeries) Context Uses

func (s *FuncFilterSeries) Context(context Context) Context

func (*FuncFilterSeries) Exec Uses

func (s *FuncFilterSeries) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncFilterSeries) Signature Uses

func (s *FuncFilterSeries) Signature() ([]Arg, []Arg)

type FuncGet Uses

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

internal function just for getting data

func (FuncGet) Context Uses

func (s FuncGet) Context(context Context) Context

func (FuncGet) Exec Uses

func (s FuncGet) Exec(dataMap DataMap) ([]models.Series, error)

func (FuncGet) Signature Uses

func (s FuncGet) Signature() ([]Arg, []Arg)

type FuncGrep Uses

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

func (*FuncGrep) Context Uses

func (s *FuncGrep) Context(context Context) Context

func (*FuncGrep) Exec Uses

func (s *FuncGrep) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncGrep) Signature Uses

func (s *FuncGrep) Signature() ([]Arg, []Arg)

type FuncGroup Uses

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

func (*FuncGroup) Context Uses

func (s *FuncGroup) Context(context Context) Context

func (*FuncGroup) Exec Uses

func (s *FuncGroup) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncGroup) Signature Uses

func (s *FuncGroup) Signature() ([]Arg, []Arg)

type FuncGroupByNodes Uses

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

func (*FuncGroupByNodes) Context Uses

func (s *FuncGroupByNodes) Context(context Context) Context

func (*FuncGroupByNodes) Exec Uses

func (s *FuncGroupByNodes) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncGroupByNodes) Signature Uses

func (s *FuncGroupByNodes) Signature() ([]Arg, []Arg)

type FuncGroupByTags Uses

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

func (*FuncGroupByTags) Context Uses

func (s *FuncGroupByTags) Context(context Context) Context

func (*FuncGroupByTags) Exec Uses

func (s *FuncGroupByTags) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncGroupByTags) Signature Uses

func (s *FuncGroupByTags) Signature() ([]Arg, []Arg)

type FuncHighestLowest Uses

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

func (*FuncHighestLowest) Context Uses

func (s *FuncHighestLowest) Context(context Context) Context

func (*FuncHighestLowest) Exec Uses

func (s *FuncHighestLowest) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncHighestLowest) Signature Uses

func (s *FuncHighestLowest) Signature() ([]Arg, []Arg)

type FuncIntegral Uses

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

func (*FuncIntegral) Context Uses

func (s *FuncIntegral) Context(context Context) Context

func (*FuncIntegral) Exec Uses

func (s *FuncIntegral) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncIntegral) Signature Uses

func (s *FuncIntegral) Signature() ([]Arg, []Arg)

type FuncInvert Uses

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

func (*FuncInvert) Context Uses

func (s *FuncInvert) Context(context Context) Context

func (*FuncInvert) Exec Uses

func (s *FuncInvert) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncInvert) Signature Uses

func (s *FuncInvert) Signature() ([]Arg, []Arg)

type FuncIsNonNull Uses

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

func (*FuncIsNonNull) Context Uses

func (s *FuncIsNonNull) Context(context Context) Context

func (*FuncIsNonNull) Exec Uses

func (s *FuncIsNonNull) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncIsNonNull) Signature Uses

func (s *FuncIsNonNull) Signature() ([]Arg, []Arg)

type FuncKeepLastValue Uses

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

func (*FuncKeepLastValue) Context Uses

func (s *FuncKeepLastValue) Context(context Context) Context

func (*FuncKeepLastValue) Exec Uses

func (s *FuncKeepLastValue) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncKeepLastValue) Signature Uses

func (s *FuncKeepLastValue) Signature() ([]Arg, []Arg)

type FuncMinMax Uses

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

func (*FuncMinMax) Context Uses

func (s *FuncMinMax) Context(context Context) Context

func (*FuncMinMax) Exec Uses

func (s *FuncMinMax) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncMinMax) Signature Uses

func (s *FuncMinMax) Signature() ([]Arg, []Arg)

type FuncMovingAverage Uses

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

func (*FuncMovingAverage) Context Uses

func (s *FuncMovingAverage) Context(context Context) Context

func (*FuncMovingAverage) Exec Uses

func (s *FuncMovingAverage) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncMovingAverage) Signature Uses

func (s *FuncMovingAverage) Signature() ([]Arg, []Arg)

note if input is 1 series, then output is too. not sure how to communicate that

type FuncNonNegativeDerivative Uses

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

func (*FuncNonNegativeDerivative) Context Uses

func (s *FuncNonNegativeDerivative) Context(context Context) Context

func (*FuncNonNegativeDerivative) Exec Uses

func (s *FuncNonNegativeDerivative) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncNonNegativeDerivative) Signature Uses

func (s *FuncNonNegativeDerivative) Signature() ([]Arg, []Arg)

type FuncOffset Uses

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

func (*FuncOffset) Context Uses

func (s *FuncOffset) Context(context Context) Context

func (*FuncOffset) Exec Uses

func (s *FuncOffset) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncOffset) Signature Uses

func (s *FuncOffset) Signature() ([]Arg, []Arg)

type FuncPerSecond Uses

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

func (*FuncPerSecond) Context Uses

func (s *FuncPerSecond) Context(context Context) Context

func (*FuncPerSecond) Exec Uses

func (s *FuncPerSecond) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncPerSecond) Signature Uses

func (s *FuncPerSecond) Signature() ([]Arg, []Arg)

type FuncRemoveAboveBelowPercentile Uses

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

func (*FuncRemoveAboveBelowPercentile) Context Uses

func (s *FuncRemoveAboveBelowPercentile) Context(context Context) Context

func (*FuncRemoveAboveBelowPercentile) Exec Uses

func (s *FuncRemoveAboveBelowPercentile) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncRemoveAboveBelowPercentile) Signature Uses

func (s *FuncRemoveAboveBelowPercentile) Signature() ([]Arg, []Arg)

type FuncRemoveAboveBelowValue Uses

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

func (*FuncRemoveAboveBelowValue) Context Uses

func (s *FuncRemoveAboveBelowValue) Context(context Context) Context

func (*FuncRemoveAboveBelowValue) Exec Uses

func (s *FuncRemoveAboveBelowValue) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncRemoveAboveBelowValue) Signature Uses

func (s *FuncRemoveAboveBelowValue) Signature() ([]Arg, []Arg)

type FuncRemoveEmptySeries Uses

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

func (*FuncRemoveEmptySeries) Context Uses

func (s *FuncRemoveEmptySeries) Context(context Context) Context

func (*FuncRemoveEmptySeries) Exec Uses

func (s *FuncRemoveEmptySeries) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncRemoveEmptySeries) Signature Uses

func (s *FuncRemoveEmptySeries) Signature() ([]Arg, []Arg)

type FuncRound Uses

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

func (*FuncRound) Context Uses

func (s *FuncRound) Context(context Context) Context

func (*FuncRound) Exec Uses

func (s *FuncRound) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncRound) Signature Uses

func (s *FuncRound) Signature() ([]Arg, []Arg)

type FuncScale Uses

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

func (*FuncScale) Context Uses

func (s *FuncScale) Context(context Context) Context

func (*FuncScale) Exec Uses

func (s *FuncScale) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncScale) Signature Uses

func (s *FuncScale) Signature() ([]Arg, []Arg)

type FuncScaleToSeconds Uses

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

func (*FuncScaleToSeconds) Context Uses

func (s *FuncScaleToSeconds) Context(context Context) Context

func (*FuncScaleToSeconds) Exec Uses

func (s *FuncScaleToSeconds) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncScaleToSeconds) Signature Uses

func (s *FuncScaleToSeconds) Signature() ([]Arg, []Arg)

type FuncSmartSummarize Uses

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

func (*FuncSmartSummarize) Context Uses

func (s *FuncSmartSummarize) Context(context Context) Context

func (*FuncSmartSummarize) Exec Uses

func (s *FuncSmartSummarize) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncSmartSummarize) Signature Uses

func (s *FuncSmartSummarize) Signature() ([]Arg, []Arg)

type FuncSortBy Uses

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

func (*FuncSortBy) Context Uses

func (s *FuncSortBy) Context(context Context) Context

func (*FuncSortBy) Exec Uses

func (s *FuncSortBy) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncSortBy) Signature Uses

func (s *FuncSortBy) Signature() ([]Arg, []Arg)

type FuncSortByName Uses

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

func (*FuncSortByName) Context Uses

func (s *FuncSortByName) Context(context Context) Context

func (*FuncSortByName) Exec Uses

func (s *FuncSortByName) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncSortByName) Signature Uses

func (s *FuncSortByName) Signature() ([]Arg, []Arg)

type FuncSummarize Uses

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

func (*FuncSummarize) Context Uses

func (s *FuncSummarize) Context(context Context) Context

func (*FuncSummarize) Exec Uses

func (s *FuncSummarize) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncSummarize) Signature Uses

func (s *FuncSummarize) Signature() ([]Arg, []Arg)

type FuncTransformNull Uses

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

func (*FuncTransformNull) Context Uses

func (s *FuncTransformNull) Context(context Context) Context

func (*FuncTransformNull) Exec Uses

func (s *FuncTransformNull) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncTransformNull) Signature Uses

func (s *FuncTransformNull) Signature() ([]Arg, []Arg)

type FuncUnique Uses

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

func (*FuncUnique) Context Uses

func (s *FuncUnique) Context(context Context) Context

func (*FuncUnique) Exec Uses

func (s *FuncUnique) Exec(dataMap DataMap) ([]models.Series, error)

func (*FuncUnique) Signature Uses

func (s *FuncUnique) Signature() ([]Arg, []Arg)

type GraphiteFunc Uses

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 Uses

func NewAbsolute() GraphiteFunc

func NewAggregate Uses

func NewAggregate() GraphiteFunc

func NewAlias Uses

func NewAlias() GraphiteFunc

func NewAliasByMetric Uses

func NewAliasByMetric() GraphiteFunc

func NewAliasByNode Uses

func NewAliasByNode() GraphiteFunc

func NewAliasSub Uses

func NewAliasSub() GraphiteFunc

func NewAsPercent Uses

func NewAsPercent() GraphiteFunc

func NewConsolidateBy Uses

func NewConsolidateBy() GraphiteFunc

func NewConstantLine Uses

func NewConstantLine() GraphiteFunc

func NewCountSeries Uses

func NewCountSeries() GraphiteFunc

func NewDerivative Uses

func NewDerivative() GraphiteFunc

func NewDivideSeries Uses

func NewDivideSeries() GraphiteFunc

func NewDivideSeriesLists Uses

func NewDivideSeriesLists() GraphiteFunc

func NewExclude Uses

func NewExclude() GraphiteFunc

func NewFallbackSeries Uses

func NewFallbackSeries() GraphiteFunc

func NewFilterSeries Uses

func NewFilterSeries() GraphiteFunc

func NewGet Uses

func NewGet(req Req) GraphiteFunc

func NewGrep Uses

func NewGrep() GraphiteFunc

func NewGroup Uses

func NewGroup() GraphiteFunc

func NewGroupByTags Uses

func NewGroupByTags() GraphiteFunc

func NewIntegral Uses

func NewIntegral() GraphiteFunc

func NewInvert Uses

func NewInvert() GraphiteFunc

func NewIsNonNull Uses

func NewIsNonNull() GraphiteFunc

func NewKeepLastValue Uses

func NewKeepLastValue() GraphiteFunc

func NewMinMax Uses

func NewMinMax() GraphiteFunc

func NewMovingAverage Uses

func NewMovingAverage() GraphiteFunc

func NewNonNegativeDerivative Uses

func NewNonNegativeDerivative() GraphiteFunc

func NewOffset Uses

func NewOffset() GraphiteFunc

func NewPerSecond Uses

func NewPerSecond() GraphiteFunc

func NewRemoveEmptySeries Uses

func NewRemoveEmptySeries() GraphiteFunc

func NewRound Uses

func NewRound() GraphiteFunc

func NewScale Uses

func NewScale() GraphiteFunc

func NewScaleToSeconds Uses

func NewScaleToSeconds() GraphiteFunc

func NewSmartSummarize Uses

func NewSmartSummarize() GraphiteFunc

func NewSortByName Uses

func NewSortByName() GraphiteFunc

func NewSummarize Uses

func NewSummarize() GraphiteFunc

func NewTransformNull Uses

func NewTransformNull() GraphiteFunc

func NewUnique Uses

func NewUnique() GraphiteFunc

type MetricRequest Uses

type MetricRequest struct {
    Metric string
    From   int32
    Until  int32
}

type Optimizations Uses

type Optimizations struct {
    PreNormalization bool
    MDP              bool
}

func (Optimizations) ApplyUserPrefs Uses

func (o Optimizations) ApplyUserPrefs(s string) (Optimizations, error)

type Plan Uses

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 Uses

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) Clean Uses

func (p Plan) Clean()

func (Plan) Dump Uses

func (p Plan) Dump(w io.Writer)

func (*Plan) Run Uses

func (p *Plan) Run(dataMap DataMap) ([]models.Series, error)

Run invokes all processing as specified in the plan (expressions, from/to) against the given datamap

type Req Uses

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 Uses

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 Uses

func NewReqFromContext(query string, c Context) Req

func NewReqFromSerie Uses

func NewReqFromSerie(serie models.Series) Req

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

func (Req) ToModel Uses

func (r Req) ToModel() models.Req

type ScoredSeries Uses

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

type Validator Uses

type Validator func(e *expr) error

Validator is a function to validate an input

Directories

PathSynopsis
tagquery

Package expr imports 23 packages (graph) and is imported by 3 packages. Updated 2020-07-13. Refresh now. Tools for package owners.