Skip to content

Commit

Permalink
Merge "Related-Bug: #1435268 d3.extent expects all elements in the ar…
Browse files Browse the repository at this point in the history
…ray to be of same type. So,For vRouters node for which CPU/Memory information is not available,set to NaN instead of '-'"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 20, 2015
2 parents bca710a + c98dff7 commit d35811c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions webroot/monitor/infra/common/ui/js/monitor_infra_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ var infraMonitorUtils = {
var d = result[i];
var dValue = result[i]['value'];
obj['cpu'] = parseFloat(getValueByJsonPath(dValue,'VrouterStatsAgent;cpu_info;cpu_share','--'));
obj['cpu'] = $.isNumeric(obj['cpu']) ? parseFloat(obj['cpu'].toFixed(2)) : '-';
obj['cpu'] = $.isNumeric(obj['cpu']) ? parseFloat(obj['cpu'].toFixed(2)) : NaN;
obj['ip'] = getValueByJsonPath(dValue,'VrouterAgent;control_ip','-');
obj['xField'] = 'cpu';
obj['yField'] = 'resMemory';
Expand Down Expand Up @@ -423,7 +423,7 @@ var infraMonitorUtils = {
obj['memory'] = formatMemory(getValueByJsonPath(dValue,'VrouterStatsAgent;cpu_info;meminfo','--'));
//Used for plotting in scatterChart
obj['resMemory'] = getValueByJsonPath(dValue,'VrouterStatsAgent;cpu_info;meminfo;res','-');
obj['resMemory'] = $.isNumeric(obj['resMemory']) ? parseFloat(parseFloat(obj['resMemory']/1024).toFixed(2)) : '-';
obj['resMemory'] = $.isNumeric(obj['resMemory']) ? parseFloat(parseFloat(obj['resMemory']/1024).toFixed(2)) : NaN;
obj['virtMemory'] = parseInt(getValueByJsonPath(dValue,'VrouterStatsAgent;cpu_info;meminfo;virt','--'))/1024;
obj['size'] = getValueByJsonPath(dValue,'VrouterStatsAgent;phy_if_1min_usage;0;out_bandwidth_usage',0) +
getValueByJsonPath(dValue,'VrouterStatsAgent;phy_if_1min_usage;0;in_bandwidth_usage',0) + 1;
Expand Down Expand Up @@ -2634,7 +2634,7 @@ function getNodeTooltipContents(currObj,formatType) {
var tooltipContents = [
{label:'Host Name', value: displayName},
{label:'Version', value:currObj['version']},
{label:'CPU', value:$.isNumeric(currObj['cpu']) ? currObj['cpu'] + '%' : currObj['cpu']},
{label:'CPU', value:$.isNumeric(currObj['cpu']) ? currObj['cpu'] + '%' : '-'},
{label:'Memory', value:$.isNumeric(currObj['memory']) ? formatMemory(currObj['memory']) : currObj['memory']}
];
if(formatType == 'simple') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ monitorInfraComputeSummaryClass = (function() {
});

var source = 'datasource';
//Set source accordingly,as certain UI widgets need no reload/refresh if updates comes from certain sources
//Like populating generators information for vRouter nodes does not need refresh on scatter chart
if(filteredNodes[0] != null && filteredNodes[0]['isGeneratorRetrieved'] == true){
source = 'generator';
}
Expand Down Expand Up @@ -347,7 +349,7 @@ monitorInfraComputeSummaryClass = (function() {
name:"CPU (%)",
minWidth:150,
formatter:function(r,c,v,cd,dc) {
return '<div class="gridSparkline display-inline"></div><span class="display-inline">' + dc['cpu'] + '</span>';
return '<div class="gridSparkline display-inline"></div><span class="display-inline">' + ifNotNumeric(dc['cpu'],'-') + '</span>';
},
asyncPostRender: renderSparkLines,
searchFn:function(d){
Expand Down

0 comments on commit d35811c

Please sign in to comment.