Fix tests after merging alerting
This commit is contained in:
16
dist/datasource-zabbix/dataProcessor.js
vendored
16
dist/datasource-zabbix/dataProcessor.js
vendored
@@ -126,6 +126,14 @@ System.register(['lodash', './utils'], function (_export, _context) {
|
||||
} else {
|
||||
return sortedTimeseries.slice(-n);
|
||||
}
|
||||
}function SUM(values) {
|
||||
var sum = 0;
|
||||
_.each(values, function (value) {
|
||||
sum += value;
|
||||
});
|
||||
return sum;
|
||||
}function COUNT(values) {
|
||||
return values.length;
|
||||
}function AVERAGE(values) {
|
||||
var sum = 0;
|
||||
_.each(values, function (value) {
|
||||
@@ -250,6 +258,8 @@ System.register(['lodash', './utils'], function (_export, _context) {
|
||||
min: _.partial(aggregateWrapper, MIN),
|
||||
max: _.partial(aggregateWrapper, MAX),
|
||||
median: _.partial(aggregateWrapper, MEDIAN),
|
||||
sum: _.partial(aggregateWrapper, SUM),
|
||||
count: _.partial(aggregateWrapper, COUNT),
|
||||
sumSeries: sumSeries,
|
||||
top: _.partial(limit, 'top'),
|
||||
bottom: _.partial(limit, 'bottom'),
|
||||
@@ -261,7 +271,9 @@ System.register(['lodash', './utils'], function (_export, _context) {
|
||||
avg: AVERAGE,
|
||||
min: MIN,
|
||||
max: MAX,
|
||||
median: MEDIAN
|
||||
median: MEDIAN,
|
||||
sum: SUM,
|
||||
count: COUNT
|
||||
};
|
||||
|
||||
_export('default', {
|
||||
@@ -271,6 +283,8 @@ System.register(['lodash', './utils'], function (_export, _context) {
|
||||
MIN: MIN,
|
||||
MAX: MAX,
|
||||
MEDIAN: MEDIAN,
|
||||
SUM: SUM,
|
||||
COUNT: COUNT,
|
||||
unShiftTimeSeries: unShiftTimeSeries,
|
||||
|
||||
get aggregationFunctions() {
|
||||
|
||||
Reference in New Issue
Block a user