Skip to main content

Module function

Module function 

Source
Expand description

Float range-vector functions as window kernels.

Each kernel follows the Prometheus function of the same name, including its floating point operation order. Arithmetic that GreptimeDB’s range UDFs compute the same way is shared with them.

StructsΒ§

ExtrapolationSpan πŸ”’
The span one window’s extrapolation factor is measured over.

EnumsΒ§

RangeFunction
A PromQL range-vector function over float and native histogram samples.

FunctionsΒ§

anchored_values πŸ”’
Prometheus pickFirstSampleIndices for an anchored window of floats: the values from the last sample at or before the window start on, or None when no sample lies after the start.
avg πŸ”’
Prometheus funcAvgOverTime: the Kahan sum divided by the count, switching to an incremental mean once the sum would overflow.
double_exponential_smoothing πŸ”’
Prometheus funcDoubleExponentialSmoothing; RangeEvaluator checks the factors.
extended_rate πŸ”’
Prometheus extendedRate: rate, increase or delta over an anchored or smoothed window. The value at the window start is the last sample at or before it, or for smoothed the interpolation between it and the next one; the end is picked or interpolated the same way. Nothing is extrapolated.
extrapolated_rate πŸ”’
Prometheus extrapolatedRate over floats.
extrapolated_rate_batch πŸ”’
The batch form of extrapolated_rate, over consecutive windows of one field at once.
extrapolated_rate_of πŸ”’
The arithmetic of extrapolated_rate, over a window’s endpoints and the previous values of its resets.
extrapolation_factor πŸ”’
The factor extrapolatedRate scales the sampled increase by. zero_point is the first value over the increase, given only when Prometheus extrapolates a counter to zero: it is the share of the sampled interval that lies before span.sampled_from, so 0 says the counter’s zero point is span.sampled_from itself, which is what a synthetic zero is.
interpolate πŸ”’
Prometheus interpolate between the samples at index and index + 1, at t: a counter that reset between them restarts from zero.
last_two πŸ”’
linear_regression πŸ”’
Prometheus linearRegression: (slope, intercept) with x in seconds from intercept_time. Needs at least two samples.
median_absolute_deviation πŸ”’
Prometheus funcMadOverTime: the median of the absolute deviations from the median; NaN when any sample is NaN.
quantile πŸ”’
Prometheus quantile, which sorts NaN before every number.
search πŸ”’
Go sort.Search(n, predicate): the first index in [0, n) the predicate holds at, or n.
seconds πŸ”’
sum πŸ”’
Prometheus funcSumOverTime.
timestamp_of_extremum πŸ”’
Prometheus compareOverTime returning the timestamp: the last sample holding the maximum (or minimum), where a NaN so far is replaced by any later sample.
variance πŸ”’
Prometheus varianceOverTime, the population variance.