functions: exponential moving average

This commit is contained in:
Alexander Zobnin
2017-07-03 23:01:18 +03:00
parent 273e6df7e3
commit f3ee574619
12 changed files with 89 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ let delta = ts.delta;
let rate = ts.rate;
let scale = (factor, datapoints) => ts.scale_perf(datapoints, factor);
let simpleMovingAverage = (n, datapoints) => ts.simpleMovingAverage(datapoints, n);
let expMovingAverage = (a, datapoints) => ts.expMovingAverage(datapoints, a);
let SUM = ts.SUM;
let COUNT = ts.COUNT;
@@ -104,6 +105,7 @@ let metricFunctions = {
delta: delta,
rate: rate,
simpleMovingAverage: simpleMovingAverage,
expMovingAverage: expMovingAverage,
aggregateBy: aggregateByWrapper,
average: _.partial(aggregateWrapper, AVERAGE),
min: _.partial(aggregateWrapper, MIN),