Expand description
Partial aggregation: the state one execution partition folds its series into, and the merge of such states into the final result.
A merge regroups the operations of a serial fold, so floating-point results differ from
aggregate_float by rounding. The same reassociation can
also move an overflow of finite values: a serial sum of [1e308, 1e308, -1e308] is +Inf,
while the merge of [1e308] and [1e308, -1e308] is finite. stddev and stdvar differ
more where the samples differ by little more than the rounding of their mean: Prometheus’
uncompensated Welford update rounds the mean on every sample, and no pairwise merge reproduces
those roundings. For [1e16] and [1e16 + 2] Prometheus gives a variance of 2 and the merge
gives the exact 1. Explicit NaN and infinite inputs follow the same rules as the serial fold. Where the serial fold keeps the first of two equal
values, as min and max do for 0 and -0, a merge keeps the one merged first.
Structs§
- Accumulator
State - The state of one field of one group at one grid point.
- Float
Merger - 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.
- Partial
Aggregate - The state of one execution partition, with its groups in the order they first appeared.
- State
Row - One Arrow-backed aggregate state row, independent of executor plumbing.
Enums§
- State
Field - A component of
AccumulatorState.
Constants§
- HISTOGRAM_
LAYOUT_ 🔒ROW_ BYTES - Bytes one one-row batch of the frame’s histogram layout costs before its bucket data.
Functions§
- add_
compensated 🔒 - The compensated sum of two partial sums. Both the other sum and its compensation are added as
Kahan addends: adding the compensation plainly would drop what the compensation already
holds once later partials cancel the sums, as merging
[1e100, 1],[-1e100, 1e84]and[-1e84]would lose the1. - exported_
payload_ 🔒bytes - Bytes one exported point’s payload builds: the boxed state and the two one-row batches
HistogramAccumulator::payloadmakes from the accumulator’s live histogram and its compensation. - extend_
spans 🔒 - Appends
positiontospans, extending the last run when it continues. - histogram_
state_ 🔒at - One present field’s histogram state at one position, read from the row’s component arrays.
- key_
bytes 🔒 - Bytes a group’s label key holds: a pair per capacity slot, and the
__name__entry, whose label and valuelabel_keycopies, each with its ownArcheader. The other label strings are the metric’s, already counted with it. - key_
workspace_ 🔒bytes - Coarse bytes the key of
metricholds while it is built: a pair per slot, the__name__label and a copy of the metric name, each with itsArcheader. - mean_
form 🔒 - The mean and its compensation, converting a sum as the serial update does on switching.
- merge_
avg 🔒 - Adds the sums while they stay finite, and otherwise continues with the count-weighted mean, as the serial update switches to an incremental mean once its sum overflows.
- merge_
count_ values - Merges
count_valuesresults 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. - missing_
payload_ 🔒component - payload_
bool 🔒 - payload_
float 🔒 - payload_
histogram 🔒 - seen_
points 🔒 - The points of
groupthat carry a state: the ones a partial of it holds. - state_
at 🔒 - One present field’s state at one position, read from the row’s component arrays.
- state_
partial 🔒 - The exported form of the state in
words, orNoneif it has seen no sample.