Commit 2b932492 by oliverpool Committed by GitHub

Add a `diff` aggregate

`diff = current - first` (when available)
parent 60a20410
......@@ -104,6 +104,7 @@ export default class TimeSeries {
this.stats.current = null;
this.stats.first = null;
this.stats.delta = 0;
this.stats.diff = null;
this.stats.range = null;
this.stats.timeStep = Number.MAX_VALUE;
this.allIsNull = true;
......@@ -193,6 +194,9 @@ export default class TimeSeries {
if (this.stats.max !== null && this.stats.min !== null) {
this.stats.range = this.stats.max - this.stats.min;
}
if (this.stats.current !== null && this.stats.first !== null) {
this.stats.diff = this.stats.current - this.stats.first;
}
this.stats.count = result.length;
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment