Repository: ambari Updated Branches: refs/heads/trunk ad3323ef6 -> f0c31d29a
AMBARI-5576. A max of 8 metric graphs are being shown for flume agents. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f0c31d29 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f0c31d29 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f0c31d29 Branch: refs/heads/trunk Commit: f0c31d29a521c2046c9660bc29fc27fac7cafb37 Parents: ad3323e Author: Aleksandr Kovalenko <[email protected]> Authored: Fri Apr 25 19:40:46 2014 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Fri Apr 25 20:22:31 2014 +0300 ---------------------------------------------------------------------- .../info/metrics/flume/flume_metric_graphs.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f0c31d29/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js index 28f07b3..1ebfb60 100644 --- a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js +++ b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js @@ -28,7 +28,6 @@ App.MainServiceInfoFlumeGraphsView = App.MainServiceInfoSummaryMetricGraphsView. var hostName = viewData.agent.get('host.hostName'); var metricNamesGatherer = { success: function(data) { - var graphs = []; var metricNames = {}; if (data != null && data.metrics != null && data.metrics.flume != null && data.metrics.flume.flume != null && data.metrics.flume.flume[metricType] != null) { for ( var name in data.metrics.flume.flume[metricType]) { @@ -38,20 +37,22 @@ App.MainServiceInfoFlumeGraphsView = App.MainServiceInfoSummaryMetricGraphsView. } } // Now that we have collected all metric names, we create - // views for each of them. - for ( var metricName in metricNames) { + // views for each of them and store them 4 in a row. + graphRows.push([]); + var graphs = graphRows[0]; + for (var metricName in metricNames) { + if (graphs.length > 3) { + graphRows.push([]); + graphs = graphRows[graphRows.length - 1]; + } graphs.push(App.ChartServiceFlumeMetricGraph.extend({ metricType: metricType, metricName: metricName, hostName: hostName })); - if (graphs.length > 3) { - graphRows.push(graphs); - graphs = []; - } } } - } + }; App.ajax.send({ 'name': 'host.host_component.flume.metrics', 'sender': metricNamesGatherer,
