Skip to main content

CkRollupFunction

Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData

Aggregation function applied by a CkRollupAggregation. Mirrors the values of the CkRollupFunction CK enum from the StreamData CK model so lifecycle / orchestrator code does not have to depend on the generated CK enum.

public enum CkRollupFunction

Inheritance ObjectValueTypeEnumCkRollupFunction
Implements IComparable, ISpanFormattable, IFormattable, IConvertible

Remarks:

CkRollupFunction.Avg is materialised at storage time as two columns ({name}_sum and {name}_count) so chained re-aggregation (rollup-of-a-rollup) stays numerically correct. The single-column average is computed on read as sum / NULLIF(count, 0). CkRollupFunction.TimeWeightedAvg follows the same pattern with an integral/duration pair — see concept-time-weighted-aggregation.md (AB#4336).

Fields

NameValueDescription
Avg0Arithmetic mean. Stored as sum + count; the average is computed on read.
Min1Minimum value in the bucket.
Max2Maximum value in the bucket.
Sum3Sum of values in the bucket.
Count4Number of non-null values in the bucket.
TimeWeightedAvg5Time-weighted average with last-observation-carried-forward interval weighting, for event-based sources (one row per state change). Stored as an integral (Σ value × Δt in value·milliseconds) + covered-duration (milliseconds) pair; the average is computed on read as integral / NULLIF(duration, 0). On a 0/100 or boolean-like signal this yields the duty cycle per bucket. AB#4336.
StateDuration6Absolute time (milliseconds) the signal held the aggregation's ComparisonValue within the bucket, with the same LOCF carry as CkRollupFunction.TimeWeightedAvg. Stored as a single BIGINT column; chained rollups re-aggregate it with SUM. AB#4336.
First7Value of the source column at the earliest timestamp in the bucket (arg_min over time). Stored as a single column; forward aggregation over a raw source picks the value at MIN(timestamp), cascades pick the child bucket with the smallest window boundary. Numeric source columns only. AB#4188.
Last8Value of the source column at the latest timestamp in the bucket (arg_max over time). Stored as a single column; forward aggregation over a raw source picks the value at MAX(timestamp), cascades pick the child bucket with the largest window boundary. Numeric source columns only. AB#4188.