Robust time derivatives
In this example we use trend estimation as a robust way to estimate the rate of change of a metric at a point in time.
every controls the interval of data we use for each estimate, and the frequency at which we update the estimate. The trend module (which is more typically used over long intervals of time) is applied to this very short interval. The slope of the fitted trend is returned by trend.rate, and the trended change over an interval as trend.change (which is in the same units as the input field, often more convenient for alerting and display)
Try different durations for
every to see its effect. The simulated cpu sends a new value every 10 seconds, so
every should be at least
:20s: so it has enough samples to fit a line to them. Longer windows will give smoother derivative curves.
In this example, a
:2m: does a good job of highlighting the big breaks in the cpu curve while ignoring the noise.