Skip to main content

Module aggregate

Module aggregate 

Source
Expand description

Local float aggregation over evaluated series, following Prometheusโ€™ aggregation. State is keyed by absolute grid index, never by local row number; sparse state and trimmed output do not expand the full grid.

Modulesยง

state ๐Ÿ”’
Partial aggregation: the state one execution partition folds its series into, and the merge of such states into the final result.

Structsยง

AccumulatorState
The state of one field of one group at one grid point.
FieldFold ๐Ÿ”’
Which field of which layout a fold is writing, and how it folds it.
FloatAggregator
aggregate_float fed one series at a time, for a caller that does not hold all its input at once. Series are folded in the order they arrive, with the same semantics.
FloatMerger
Merges the partial states of one aggregation into its result. Groups are identified by their full label set, already grouped by the partitions, and keep the order they first arrive in.
FloatState ๐Ÿ”’
The float part of Prometheusโ€™ groupedAggregation, as a view of one stateโ€™s words.
Group ๐Ÿ”’
HistogramAccumulator ๐Ÿ”’
One positionโ€™s histogram fold: the live payload, the compensation paired with it, the running mean an average switched to, and the evidence the fold recorded beside them.
HistogramEvidence ๐Ÿ”’
The evidence bits a histogram fold records beside its payload.
PartialAggregate
The state of one execution partition, with its groups in the order they first appeared.

Enumsยง

AggregateOp
Float aggregations without a parameter.
Grouping
Grouping by series labels. No modifier is By(&[]), as in Prometheus.
HistogramSamples ๐Ÿ”’
What an aggregate does with a native histogram sample.
StateField
A component of AccumulatorState.
Value ๐Ÿ”’
The value of a count_values sample, as it is grouped.

Constantsยง

BLOCK_POINTS ๐Ÿ”’
Grid points per state block. A block is allocated only once a sample falls in it, so sparse input never expands to the full grid and dense input costs one allocation per block.

Functionsยง

accumulator_bytes ๐Ÿ”’
Bytes one histogram position holds: every histogram it keeps, with buckets, bounds and spans.
aggregate_float
Aggregates each field at each absolute evaluation instant.
aggregate_quantile
quantile(q, v), with q read at each grid point from an unlabelled single-field scalar on the same grid, as Prometheus evaluates the parameter at every step. A point where q has no value has no result; q outside [0, 1] or NaN gives what Prometheusโ€™ quantile gives.
block_bytes ๐Ÿ”’
Bytes one allocated block keeps: a state per point per field, AggregateOp::state_words words of f64 each. The fold, the merge and the recount all size a block through this, so what is admitted and what is allocated cannot drift apart.
btree_backing_bytes ๐Ÿ”’
An upper bound on the bytes a B-tree of entries holds.
btree_node_bytes ๐Ÿ”’
An upper bound on the bytes one B-tree node holds.
count_series ๐Ÿ”’
count_values
count_values(label, v): at each grid point, the number of samples in each group of series that share a value, with the value written to label in Prometheusโ€™ FormatFloat(v, 'f', -1) form, or for a native histogram as its FloatHistogram.String. With by, label is part of the grouping; with without, it is dropped if listed.
decoded_histogram ๐Ÿ”’
The histogram a payload component carries.
evidence_summary ๐Ÿ”’
The evidence a fold or a merge has to report, once, wherever it finishes.
finish_groups ๐Ÿ”’
The result of every group, without a budget: the entry the partial-state merger takes, which does not hold a query pool to admit against.
finish_groups_budgeted ๐Ÿ”’
Turns the state of groups into result series, in group order, admitting as it builds.
finish_histogram_group ๐Ÿ”’
Builds one groupโ€™s histogram result, or None when it has nothing left to answer.
finish_working_bytes ๐Ÿ”’
finished_histogram ๐Ÿ”’
One positionโ€™s answer, compacted, or None when the point was poisoned.
group_rows_runs ๐Ÿ”’
grouping_bytes ๐Ÿ”’
grouping_workspace_bytes ๐Ÿ”’
hash_map_backing_bytes ๐Ÿ”’
Conservative backing estimate for Rust 1.98.1โ€™s insert-only HashMap (hashbrown 0.17.1). Bucket count follows its 7/8 load factor; entries, one control byte per bucket and the 16-byte control-group tail are counted. This models requested table storage, not allocator slack. An upper bound on the bytes the group index holds for capacity entries.
histogram_backing_bytes ๐Ÿ”’
An upper bound on the bytes a histogram map of entries holds, like btree_backing_bytes.
histogram_batch ๐Ÿ”’
One histogram as the frame payloadโ€™s own one-row batch.
histogram_finish_bytes ๐Ÿ”’
Bytes finish_histogram_group works in while it builds one groupโ€™s result.
histogram_node_bytes ๐Ÿ”’
An upper bound on the bytes one node of a groupโ€™s histogram map holds.
histogram_samples ๐Ÿ”’
What op does with a native histogram sample.
kahan_inc ๐Ÿ”’
Prometheus kahansum.Inc, with the Neumaier swap.
label_key ๐Ÿ”’
labels_capacity_bytes ๐Ÿ”’
merge_count_values
Merges count_values results of several partitions. Each partial already carries its full output label set, value label included, so series with one label set add their counts point by point and field by field.
metric_bytes ๐Ÿ”’
next_hash_capacity ๐Ÿ”’
An upper bound on the capacity a map holding capacity entries grows to.
pending_bytes ๐Ÿ”’
Transient bytes the fold needs for one fieldโ€™s row while it folds a series. The samples are written straight into their blocks, so a blockโ€™s staging buffer is no longer part of this.
state_finish ๐Ÿ”’
The value the state in words finishes to, or None if it has seen no sample.
state_seen ๐Ÿ”’
Whether the state in words has seen a sample: its presence word is set.
update_avg ๐Ÿ”’
avgโ€™s update: sums directly until the running sum would overflow, then switches to an incremental mean, whose flag is the fourth word.
validate_aggregate_series ๐Ÿ”’
Checks a series for the aggregate op folds, and returns its evaluated axis.
validate_count_values ๐Ÿ”’
Validates the schema-only requirements shared by the kernel and native runtime construction.
validate_grouping ๐Ÿ”’
validate_input ๐Ÿ”’
Schema validation is repeated because Series exposes its fields publicly.
validate_vector_grouping ๐Ÿ”’
Validates the grouping a whole-vector operation addresses its series by.

Type Aliasesยง

Counts ๐Ÿ”’
Counts per point and field: one series per label set, a count of 0 being no sample.
LabelKey ๐Ÿ”’