Skip to main content

Step 2: Sliding Windows

While tumbling windows are great for discrete summaries, sliding windows are used for calculating smooth, moving averages. The key difference is that in a sliding window, a single event can belong to multiple, overlapping windows.

The Goal​

Compute summaries over overlapping windows so consecutive results share events.

Implementation​

The complete configuration owns the maintained sliding-window implementation. Its system_window buffer retains five minutes of events and emits every minute. Mappings select records for each aggregation type before grouping and calculating batch statistics.

Cache TTLs and duplicate cache keys do not implement event accumulation. Review late-arrival behavior against the configured event timestamps before adapting the buffer.

Verification​

Check window boundaries, event counts, and temperature statistics across consecutive windows. The configured production intervals remain independent of fixture time scaling.