This is an example for computing running statistics with Lua backed by a hash in Redis. We support counting, average (with and without exponential smoothing), stddev, variance, min, max, sum of observed values. An example for approximating a running median can be found here: https://gist.github.com/thomasdarimont/fff68191d45a001b2d84
We use a hash
for storing various statistic value under the key "stats_value" in redis.
Note: If you need a specific alpha value for smoothing the average, then set the desired alpha -> e.g. alpha 0.7.
If alpha is 0.0 then no smoothing is applied.