mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add a diff aggregate
`diff = current - first` (when available)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user