PR for request #562
https://github.com/alexanderzobnin/grafana-zabbix/issues/562
This commit is contained in:
21
dist/datasource-zabbix/dataProcessor.js
vendored
21
dist/datasource-zabbix/dataProcessor.js
vendored
@@ -21,6 +21,24 @@ System.register(['lodash', './utils', './timeseries'], function (_export, _conte
|
||||
}
|
||||
}
|
||||
|
||||
function removeAboveValue(n, datapoints) {
|
||||
return _.map(datapoints, function (point) {
|
||||
return [point[0] > n ? null : point[0], point[1]];
|
||||
});
|
||||
}
|
||||
|
||||
function removeBelowValue(n, datapoints) {
|
||||
return _.map(datapoints, function (point) {
|
||||
return [point[0] < n ? null : point[0], point[1]];
|
||||
});
|
||||
}
|
||||
|
||||
function transformNull(n, datapoints) {
|
||||
return _.map(datapoints, function (point) {
|
||||
return [point[0] !== null ? point[0] : n, point[1]];
|
||||
});
|
||||
}
|
||||
|
||||
function sortSeries(direction, timeseries) {
|
||||
return _.orderBy(timeseries, [function (ts) {
|
||||
return ts.target.toLowerCase();
|
||||
@@ -142,6 +160,7 @@ System.register(['lodash', './utils', './timeseries'], function (_export, _conte
|
||||
rate: rate,
|
||||
movingAverage: simpleMovingAverage,
|
||||
exponentialMovingAverage: expMovingAverage,
|
||||
transformNull: transformNull,
|
||||
aggregateBy: aggregateByWrapper,
|
||||
// Predefined aggs
|
||||
percentil: percentil,
|
||||
@@ -152,6 +171,8 @@ System.register(['lodash', './utils', './timeseries'], function (_export, _conte
|
||||
sum: _.partial(aggregateWrapper, SUM),
|
||||
count: _.partial(aggregateWrapper, COUNT),
|
||||
sumSeries: sumSeries,
|
||||
removeAboveValue: removeAboveValue,
|
||||
removeBelowValue: removeBelowValue,
|
||||
top: _.partial(limit, 'top'),
|
||||
bottom: _.partial(limit, 'bottom'),
|
||||
sortSeries: sortSeries,
|
||||
|
||||
Reference in New Issue
Block a user