Skip to content

Commit

Permalink
Related-Bug:#1581650
Browse files Browse the repository at this point in the history
1)New color scheme for config node & analytics node summary pages.
2)Subtracting the failed records from total records.

Closes-Bug:#1581650
Did the following changes,
1)Using the start time and end time in query response for bucketizing the data, instead of the min & max time stamp of
response to make sure always the bars are of same width irrespective of data
2)When there is not data for a given bucket, adding 0.01 times the max value/height(in case data is 0) as data to improve look and feel.

Closes-Bug:#1581650
Handled the following in monitor infra config & Analytics nodes summary page
1)Irrespective of the response of chart queries legends will show all nodes
2)Add the tooltips for the legend which will show the node name
3)Fixed the issue, same node is getting assigned different colors across the charts in same page.

Closed-Bug:#1581650
1)Replaced the database reads stack bar chart with analytics database usage in analytics summary page
2)Fixed the issue last bar is hidden in all summary page stack charts.

Closes-Bug:#1581650
Changed the timestamp field from T to T= in sandesh message query in analytics node summary page chart
& fixed the legend showing color code instead of node name summary page charts.

Closes-Bug:#1610850
1)Fixed the issue analytics node summary page charts are not loading.
2)Added the cache and increased the ajax call timeout to 2 mins for config and analytics node summary charts.

Change-Id: I153e178f34fa2a3fd706399c0d97172e312b6bd5
  • Loading branch information
vishnuvv committed Aug 10, 2016
1 parent 3f928bf commit 10a3f79
Show file tree
Hide file tree
Showing 15 changed files with 376 additions and 152 deletions.
2 changes: 2 additions & 0 deletions webroot/common/ui/js/controller.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function getControllerAppPaths (ctBaseDir, ctBuildDir,env) {
'monitor-infra-analytics-sandesh-chart-model': ctWebDir + '/monitor/infrastructure/analyticsnode/ui/js/models/AnalyticsNodeSandeshChartModel',
'monitor-infra-analytics-queries-chart-model': ctWebDir + '/monitor/infrastructure/analyticsnode/ui/js/models/AnalyticsNodeQueriesModel',
'monitor-infra-analytics-database-read-write-chart-model': ctWebDir + '/monitor/infrastructure/analyticsnode/ui/js/models/AnalyticsNodeDatabaseWriteReadModel',
'monitor-infra-analytics-database-usage-model': ctWebDir + '/monitor/infrastructure/common/ui/js/models/DatabaseUsageModel',
'monitor-infra-analyticsnode-model' : ctWebDir + '/monitor/infrastructure/common/ui/js/models/AnalyticsNodeListModel',
'monitor-infra-databasenode-model' : ctWebDir + '/monitor/infrastructure/common/ui/js/models/DatabaseNodeListModel',
'monitor-infra-controlnode-model' : ctWebDir + '/monitor/infrastructure/common/ui/js/models/ControlNodeListModel',
Expand Down Expand Up @@ -116,6 +117,7 @@ function getControllerAppPaths (ctBaseDir, ctBuildDir,env) {

'controller-init': ctWebDir + '/common/ui/js/controller.init',
'controller-dashboard-libs': ctWebDir + '/monitor/infrastructure/common/ui/js/monitor.infra.module',
'monitor-infra-analytics-database-usage-model': ctWebDir + '/monitor/infrastructure/common/ui/js/models/DatabaseUsageModel',
//Monitor Infra analytics charts
'monitor-infra-analytics-sandesh-chart-model': ctWebDir + '/monitor/infrastructure/analyticsnode/ui/js/models/AnalyticsNodeSandeshChartModel',
'monitor-infra-analytics-queries-chart-model': ctWebDir + '/monitor/infrastructure/analyticsnode/ui/js/models/AnalyticsNodeQueriesModel',
Expand Down
5 changes: 5 additions & 0 deletions webroot/common/ui/js/controller.labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ define([
this.ANALYTICS_CHART_DATABASE_READ_STACKEDBARCHART_ID = "analytics-chart-database-read-stackedbarchart-id";
this.ANALYTICS_CHART_DATABASE_READ_LABEL = "DB Reads";
this.ANALYTICS_CHART_FAILED_DATABASE_READS = "Failed DB Reads";
this.ANALYTICS_CHART_DATABASE_USAGE = "DB Usage";
this.ANALYTICS_CHART_DATABASE_WRITE_SECTION_ID = "analytics-chart-database-write-section-id";
this.ANALYTICS_CHART_DATABASE_WRITE_STACKEDBARCHART_ID = "analytics-chart-database-write-stackedbarchart-id";
this.ANALYTICS_CHART_DATABASE_WRITE_LABEL = "DB Writes";
Expand All @@ -385,6 +386,10 @@ define([
this.ANALYTICS_CHART_DATABASE_WRITE = "table_info.writes";
this.ANALYTICS_CHART_DATABASE_WRITE_FAILS = "table_info.write_fails";
this.ANALYTICS_NODES = 'Analytics Nodes';
this.CACHE_ANALYTICSNODE_SANDESH_CHARTS = 'cache-analyticsnode-sandesh-charts';
this.CACHE_ANALYTICSNODE_QUERIES_CHARTS = 'cache-analyticsnode-queries-charts';
this.CACHE_ANALYTICSNODE_DATABASEREADWRITE_CHARTS = 'cache-analyticsnode-databsereadwrite-charts';
this.CACHE_DATABASE_USAGE_CHARTS = 'cache-databse-usage-charts';
//Config node labels
this.CONFIGNODE_VIEWPATH_PREFIX = 'monitor/infrastructure/confignode/ui/js/views/';
this.CONFIGNODE_SUMMARY_PAGE_ID = 'monitor-config-nodes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,21 @@ define([
ajaxConfig : {
url : "/api/qe/query",
type: 'POST',
data: JSON.stringify(queryPostData)
data: JSON.stringify(queryPostData),
timeout : 120000 //2 mins
},
dataParser : function (response) {
listModel.queryJSON = response['queryJSON'];
return response['data'];
}
},
cacheConfig : {}
cacheConfig : {
ucid: ctwl.CACHE_ANALYTICSNODE_DATABASEREADWRITE_CHARTS
}
};

return ContrailListModel(listModelConfig);
var listModel = new ContrailListModel(listModelConfig)
return listModel;
};
return AnalyticsNodeDatabaseWriteReadModel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ define([
ajaxConfig : {
url : "/api/qe/query",
type: 'POST',
data: JSON.stringify(queryPostData)
data: JSON.stringify(queryPostData),
timeout : 120000 //2 mins
},
dataParser : function (response) {
listModel.queryJSON = response['queryJSON'];
return response['data'];
}
},
cacheConfig : {}
cacheConfig : {
ucid: ctwl.CACHE_ANALYTICSNODE_QUERIES_CHARTS
}
};

return ContrailListModel(listModelConfig);
var listModel = new ContrailListModel(listModelConfig)
return listModel;
};
return AnalyticsNodeQueriesModel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ define([
"table_name": "StatTable.SandeshMessageStat.msg_info",
"table_type": "STAT",
"query_prefix": "stat",
"time_range": "3600",
"from_time": Date.now() - (2 * 60 * 60 * 1000),
"from_time_utc": Date.now() - (2 * 60 * 60 * 1000),
"to_time": Date.now(),
"to_time_utc": Date.now(),
"select": "Source, T, UUID, msg_info.messages," +
" name",
"select": "Source, T=, SUM(msg_info.messages)",
"time_granularity": 150,
"time_granularity_unit": "secs",
"limit": "150000"
},
Expand All @@ -29,16 +28,20 @@ define([
ajaxConfig : {
url : "/api/qe/query",
type: 'POST',
data: JSON.stringify(queryPostData)
data: JSON.stringify(queryPostData),
timeout : 120000 //2 mins
},
dataParser : function (response) {
listModel.queryJSON = response['queryJSON'];
return response['data'];
}
},
cacheConfig : {}
cacheConfig : {
ucid: ctwl.CACHE_ANALYTICSNODE_SANDESH_CHARTS
}
};

return ContrailListModel(listModelConfig);
var listModel = new ContrailListModel(listModelConfig)
return listModel;
};
return AnalyticsNodeSandeshChartModel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#config-nodes-linebarchart{
width:43% !important;
}
#analytics-chart-queries-stackedbarchart-id .chart-container g.main text.axis-label, #analytics-chart-database-read-stackedbarchart-id .chart-container g.main text.axis-label, #analytics-chart-database-write-stackedbarchart-id .chart-container g.main text.axis-label{
#analytics-chart-sandesh-stackedbarchart-id .chart-container g.main text.axis-label, #analytics-chart-queries-stackedbarchart-id .chart-container g.main text.axis-label, #analytics-chart-database-read-stackedbarchart-id .chart-container g.main text.axis-label, #analytics-chart-database-write-stackedbarchart-id .chart-container g.main text.axis-label{
text-anchor:middle;
font-weight:600;
font-size:11px !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ define([
ajaxConfig : {
url : "/api/qe/query",
type: 'POST',
data: JSON.stringify(queryPostData)
data: JSON.stringify(queryPostData),
timeout : 120000 //2 mins
},
dataParser : function (response) {
listModel.queryJSON = response['queryJSON'];
return response['data'];
}
},
cacheConfig : {
ucid: ctwl.CACHE_CONFIGNODE_CHARTS
}
};

return ContrailListModel(listModelConfig);
var listModel = new ContrailListModel(listModelConfig)
return listModel;
};
return ConfigNodeChartsModel;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/

define([
'contrail-list-model'
], function (ContrailListModel) {
var DatabaseUsageModel = function () {
var queryPostData = {
"autoSort": true,
"async": false,
"formModelAttrs": {
"table_name": "StatTable.DatabaseUsageInfo.database_usage",
"table_type": "STAT",
"query_prefix": "stat",
"time_range": "3600",
"from_time": Date.now() - (2 * 60 * 60 * 1000),
"from_time_utc": Date.now() - (2 * 60 * 60 * 1000),
"to_time": Date.now(),
"to_time_utc": Date.now(),
"select": "Source, T, MAX(database_usage.analytics_db_size_1k)",
"time_granularity_unit": "secs",
"limit": "150000"
},
};
var listModelConfig = {
remote : {
ajaxConfig : {
url : "/api/qe/query",
type: 'POST',
data: JSON.stringify(queryPostData),
timeout : 120000 //2 mins
},
dataParser : function (response) {
var stats = getValueByJsonPath(response, 'data', []);
$.each(stats, function(idx, obj) {
obj['MAX(database_usage.analytics_db_size_1k)'] =
ifNull(obj['MAX(database_usage.analytics_db_size_1k)'],0) * 1024; //Converting KB to Bytes
});
listModel.queryJSON = response['queryJSON'];
return stats;
}
},
cacheConfig : {
ucid: ctwl.CACHE_DATABASE_USAGE_CHARTS
}
};
var listModel = new ContrailListModel(listModelConfig)
return listModel;
};
return DatabaseUsageModel;
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ define([

this.HOST_DPDK = 'HOST_DPDK';

//Color scheme for monitor infra nodes
this.SINGLE_NODE_COLOR = ['#adcfdc'];
this.THREE_NODE_COLOR = ['#a8c0d1', '#6f97ae', '#617683']
this.FIVE_NODE_COLOR = ['#819eb5', '#6b8295', '#876f8a', '#b2a198', '#eccc9b'];

//Config Summary page Constants
this.CONFIGNODESTATS_BUCKET_DURATION = 150000000;
this.CONFIGNODE_COLORS = ['#b0c8c3', '#bf94e0', '#5d6e7e', '#b2a198', '#eccc9b'];
this.CONFIGNODE_FAILEDREQUESTS_TITLE = 'Failed Requests';
this.CONFIGNODE_FAILEDREQUESTS_COLOR = '#d95436';
this.CONFIGNODE_RESPONSESIZE_COLOR = '#7f9d92';

this.monitorInfraUrls = {
TENANT_API_URL : "/api/tenant/get-data",
Expand Down

0 comments on commit 10a3f79

Please sign in to comment.