Triggers query mode, allow to get active triggers count, #141

This commit is contained in:
Alexander Zobnin
2017-10-22 14:30:54 +03:00
parent dacc3f3576
commit 6c64f21b1a
26 changed files with 458 additions and 88 deletions

View File

@@ -109,6 +109,17 @@ function handleSLAResponse(itservice, slaProperty, slaObject) {
}
}
function handleTriggersResponse(triggers, timeRange) {
if (_lodash2.default.isNumber(triggers)) {
return {
target: "triggers count",
datapoints: [[triggers, timeRange[1]]]
};
} else {
return triggers;
}
}
function convertHistoryPoint(point) {
// Value must be a number for properly work
return [Number(point.value), point.clock * 1000 + Math.round(point.ns / 1000000)];
@@ -144,7 +155,8 @@ exports.default = {
convertHistory: convertHistory,
handleTrends: handleTrends,
handleText: handleText,
handleSLAResponse: handleSLAResponse
handleSLAResponse: handleSLAResponse,
handleTriggersResponse: handleTriggersResponse
};
// Fix for backward compatibility with lodash 2.4