- compact_state_agg: Track time spent in each state with minimal memory usage
- state_agg: Track state transitions with full timestamp information
- heartbeat_agg: Monitor system liveness based on heartbeat signals
Two-step aggregation
This group of functions uses the two-step aggregation pattern. Rather than calculating the final result in one step, you first create an intermediate aggregate by using the aggregate function. Then, use any of the accessors on the intermediate aggregate to calculate a final result. You can also roll up multiple intermediate aggregates with the rollup functions. The two-step aggregation pattern has several advantages:- More efficient because multiple accessors can reuse the same aggregate
- Easier to reason about performance, because aggregation is separate from final computation
- Easier to understand when calculations can be rolled up into larger intervals, especially in window functions and continuous aggregates
- Perform retrospective analysis even when underlying data is dropped, because the intermediate aggregate stores extra information not available in the final result
Samples
Track time in different states
Use compact_state_agg to efficiently track how much time a system spends in each state:Analyze state transitions
Use state_agg to track when state transitions occur:Monitor system liveness
Use heartbeat_agg to track uptime and downtime:Available functions
Compact state aggregation
compact_state_agg(): track time spent in states with minimal memory usage
State aggregation with transitions
state_agg(): track state transitions with full timestamp information
Heartbeat monitoring
heartbeat_agg(): monitor system liveness based on heartbeat signals