Sort trend data, fixes #202
This commit is contained in:
4
dist/test/datasource-zabbix/constants.js
vendored
4
dist/test/datasource-zabbix/constants.js
vendored
@@ -19,3 +19,7 @@ var SEV_DISASTER = exports.SEV_DISASTER = 5;
|
||||
var SHOW_ALL_TRIGGERS = exports.SHOW_ALL_TRIGGERS = [0, 1];
|
||||
var SHOW_ALL_EVENTS = exports.SHOW_ALL_EVENTS = [0, 1];
|
||||
var SHOW_OK_EVENTS = exports.SHOW_OK_EVENTS = 1;
|
||||
|
||||
// Data point
|
||||
var DATAPOINT_VALUE = exports.DATAPOINT_VALUE = 0;
|
||||
var DATAPOINT_TS = exports.DATAPOINT_TS = 1;
|
||||
|
||||
9
dist/test/datasource-zabbix/datasource.js
vendored
9
dist/test/datasource-zabbix/datasource.js
vendored
@@ -205,6 +205,15 @@ var ZabbixAPIDatasource = function () {
|
||||
var valueType = _this2.getTrendValueType(target);
|
||||
getHistoryPromise = _this2.zabbix.getTrend(items, timeFrom, timeTo).then(function (history) {
|
||||
return _responseHandler2.default.handleTrends(history, items, valueType);
|
||||
}).then(function (timeseries) {
|
||||
// Sort trend data, issue #202
|
||||
_lodash2.default.forEach(timeseries, function (series) {
|
||||
series.datapoints = _lodash2.default.sortBy(series.datapoints, function (point) {
|
||||
return point[c.DATAPOINT_TS];
|
||||
});
|
||||
});
|
||||
|
||||
return timeseries;
|
||||
});
|
||||
})();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user