iss #19 - Get IT service data and handle response.

This commit is contained in:
Alexander Zobnin
2015-07-25 18:17:38 +03:00
parent d2db53fcfb
commit 218f8b8f35
2 changed files with 98 additions and 70 deletions

View File

@@ -109,6 +109,24 @@ function (angular, _) {
});
};
/**
* Convert Zabbix API service.getsla response to Grafana format
*
* @param itservice
* @param slaProperty
* @param slaObject
* @returns {{target: *, datapoints: *[]}}
*/
this.handleSLAResponse = function (itservice, slaProperty, slaObject) {
var targetSLA = slaObject[itservice.serviceid].sla[0];
return {
target: itservice.name,
datapoints: [
[targetSLA[slaProperty.property], targetSLA.to * 1000]
]
};
};
/**
* Expand item parameters, for example:
* CPU $2 time ($3) --> CPU system time (avg1)