Update url and return data for metrics api

Change-Id: Idd48f1d5668f7984ec8a8bd7662deacc786990b2
This commit is contained in:
jiahuay 2014-10-14 18:12:52 -07:00
parent 3e95a4b393
commit bae628e9ca
5 changed files with 49 additions and 41 deletions

File diff suppressed because one or more lines are too long

View File

@ -68,12 +68,14 @@
useInteractiveGuideline="true"
toolTipContent="toolTipContentFunction()"
xAxisTickFormat="xAxisTickFormatFunction()"
yAxisTickFormat="yAxisTickFormatFunction()"
margin="{left:50,top:50,bottom:50,right:50}"
forceY="[0]"
showLegend="true"
objectEquality="true"
legendWidth="200"
legendHeight="100">
legendHeight="100"
noData="No Data Available">
<svg></svg>
</nvd3-line-chart>

View File

@ -117,12 +117,12 @@ define(['angularAnimate', 'angularUiTree', 'nvd3Directive'], function() {
// TODO
});
$scope.metrics = [];
/*$scope.metrics = [];
dataService.monitorMetrics().success(function(data) {
$scope.metrics = data;
}).error(function(response) {
// TODO
});
});*/
$scope.metricsName = [];
dataService.monitorMetricsName().success(function(data) {
@ -178,6 +178,12 @@ define(['angularAnimate', 'angularUiTree', 'nvd3Directive'], function() {
}
};
$scope.yAxisTickFormatFunction = function(){
return function(d){
return d3.format(',d')(d);
}
};
$scope.toolTipContentFunction = function() {
return function(key, x, y, e, graph) {
return 'Super New Tooltip' +

View File

@ -230,21 +230,21 @@ define(['angular'], function() {
return $http.get(settings.monitoringUrlBase + '/proxy/' + px_url);
};
*/
this.monitorMetrics = function() {
/*this.monitorMetrics = function() {
// This returns a flat json list of metrics currently or historically have been collected
// /monit/api/metrics
return $http.get(settings.monitoringUrlBase + '/metrics');
};
};*/
this.monitorMetricsName = function() {
return $http.get(settings.monitoringUrlBase + '/metricsName');
return $http.get(settings.monitoringUrlBase + '/metricnames');
};
this.monitorMetricsTree = function() {
// This will also order the metrics in a tree
// /monit/api/metricstree
return $http.get(settings.monitoringUrlBase + '/metricstree');
return $http.get(settings.monitoringUrlBase + '/metrictree');
};
this.monitorHostMetric = function(clusterId, hostName, metricName) {

View File

@ -595,10 +595,10 @@ define(['angular', 'ganttChart'], function(angular, ganttChart) {
//var hostnames = scope.hosts;
var taskStatus = {
"SUCCESSFUL": "bar-successful",
"CRITICAL": "bar-failed",
"WARNING": "bar-warning",
"UNKNOWN": "bar-unknown"
"successful": "bar-successful",
"critical": "bar-failed",
"warning": "bar-warning",
"unknown": "bar-unknown"
};
tasks.sort(function(a, b) {