Skip to main content

Module range_eval

Module range_eval 

Source
Expand description

Range-vector window evaluation of raw series onto an evaluation grid.

ModulesΒ§

function πŸ”’
Float range-vector functions as window kernels.
histogram πŸ”’
Range functions over windows that hold native histogram samples, following the histogram branches of Prometheus’ range functions. Windows of floats alone never get here.

StructsΒ§

BulkScratch πŸ”’
The buffers the bulk ingest needs for a chunk whose samples are not retained as they arrive: the timestamps shifted by the selector offset, and one compacted column per field.
CounterReset πŸ”’
One counter reset: a sample that dropped below the sample before it.
FieldSamples πŸ”’
FloatWindow πŸ”’
The valid samples of one field inside one window, in source order.
FloatWindows πŸ”’
The windows of one field at consecutive grid points, as ranges into the field’s retained samples.
PendingBatch πŸ”’
Windows accumulated for the next batch call: one list per field.
RangeEvaluator
Evaluates range windows over raw series, one series at a time, handing out its results as they become final.
RangeWindow
The samples a range selector reads at evaluation time T: source timestamps in (E - range_ms, E], where E is T - offset_ms, or anchor_ms - offset_ms with @. A modifier widens that: anchored also reads the lookback before E - range_ms, smoothed the lookback on both sides, and a scan feeding the window has to read that much more.
RowEvaluator πŸ”’
Computes the result of every field’s window at one grid point.
SeriesState πŸ”’

EnumsΒ§

RangeFunction
A PromQL range-vector function over float and native histogram samples.
RangeModifier
The experimental range selector modifiers of Prometheus, which read samples beyond the window to pin its boundary values. Not to be confused with an @ anchor, which fixes the window’s end.
Replay πŸ”’
How the windows of an @-anchored selector map to the grid.

ConstantsΒ§

EVALUATION_BATCH πŸ”’
Grid points accumulated before a batch kernel call. Sized to keep the per-field span and column buffers in cache while staying large enough to amortise the call.

FunctionsΒ§

accumulate πŸ”’
Records one point for the next batch call: its evaluation timestamp and, per field, the range of retained samples its window covers.
boxed_bytes πŸ”’
The bytes the histograms a row holds box, beyond the slots they sit in.
check_modifier πŸ”’
Rejects a modifier on a function Prometheus does not allow it with, as Prometheus rejects the query (AnchoredSafeFunctions, SmoothedSafeFunctions), and on evaluated input, which reads no raw samples around its windows.
flush_batch πŸ”’
Runs the batch kernel over the accumulated points and appends its columns.
fold_offset πŸ”’
The offset samples are shifted by: the selector offset, or for @ the offset that places the anchored window at the first grid point.
predict_linear_instants πŸ”’
Checks that predict_linear can read the instant of every point of grid once shifted by fold_offset.
resets_between πŸ”’
The resets inside the window over the absolute positions [start, end).
subquery_grid
The inner grid of a subquery read by window from the outer grid outer: the multiples of step_ms after start - F - range up to the last window end, where F is the fold offset of window; with @, the only window end is start - F. None when no multiple falls in the windows.
timestamp_le πŸ”’

Type AliasesΒ§

BatchKernel πŸ”’
Computes a batch of one field’s windows at once, appending one result per window to out.
WindowKernel πŸ”’
Computes one window result; None means the window has no result.