← Docs
Recipe

Steady-state hypothesis monitor

Detect when a monitored system has reached equilibrium so you can stop burning compute on transient noise.

Ingredients

  • Sliding window of the last N observations
  • Linear regression over the window
  • Slope threshold ε for declaring flat
  • Consecutive-flat counter with hysteresis

Method

  1. Push each incoming metric into a fixed-size ring buffer.
  2. Once the buffer is full, fit a least-squares line to the points.
  3. If |slope| < ε, increment the flat counter; otherwise reset it to zero.
  4. When the flat counter exceeds a configured threshold K, emit a STEADY event and suppress further emissions until the slope breaks the band.

Tuning

ParameterStartNotes
Window N60Larger = more lag, less jitter
Slope ε0.001Scale-dependent; normalize first
Flat count K5Prevents premature steady declaration

Gotchas

A flat slope on raw values can mask constant-rate drift. Consider differencing the series first if the process has a known trend component. Also guard against empty windows on cold start — defer evaluation until the buffer saturates.