I have metric "monitor.status" with values 0 and 1. 0 indicating service down state and 1 - up state.
I'd like to render downtime period in seconds in Single stat panel. How to get the time metric was in 0 state and render it?
Example:
Value - Timestamp (just h:m to simplify) 1 - 05:00 1 - 05:05 0 - 05:07 0 - 05:09 1 - 05:11 0 - 05:16 0 - 05:18 Here metric was is "0" state for 4 minutes. This is the value I'd like to get.
Do you have any suggestions how to track downtime period correctly in graphite?
In this particular case, it can be e.g.
Example: If monitor.status is
[0,0,1,1,1,1,1,0,0,1]
thencountSeries(monitor.status) = [10,10,10,10,10,10,10,10,10,10]
anddivideSeries(monitor.status, countSeries(monitor.status)) = [0,0,0.1,0.1,0.1,0.1,0.1,0,0,0.1]
andintegral()
of series above will give you0.6
at the end of result which stat will show to you. Just do not forget to changeMax data points
of stat panel to 1, otherwise, you'll get less than 0.6