kriskowal / gtor

A General Theory of Reactivity
MIT License
3.03k stars 109 forks source link

Describe pressure relief strategies #28

Open kriskowal opened 9 years ago

kriskowal commented 9 years ago

I am overdue to talk about the three different approaches to pressure relief with time-series observables and when to use them: gauges, accumulate+flush counters (counters in statsd parlance), and monotonic counters (timers in statsd parlance).

Gauges are good for continuous data sampled (pulled or polled) periodically, so a behavior goes in and a signal comes out. Gauges can be resampled at different resolutions with averages, deviation, and other statistics.

Counters are good for discrete data, push, and relieve pressure by accumulating and flushing periodically, so a signal goes in and a periodic signal comes out. They can be resampled or derived at different resolutions to produce rate or flow measurement gauges.

Accumulate and flush counters are good for measuring relative values (like how many events happened in a time interval) and monotonic counters are good for measuring absolute values like time and temperature. Monotonic counters that are measured at a certain resolution and infrequently overflow have the nice property that, as long as they are measured within a minimum frequency, can infer that they have overflowed by noticing a very high value became a very low value, and adjusting the resolution accordingly.