Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC13018940 for ; Wed, 28 Oct 2015 09:34:09 +0000 (UTC) Received: (qmail 24739 invoked by uid 500); 28 Oct 2015 09:34:09 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 24709 invoked by uid 500); 28 Oct 2015 09:34:09 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 24700 invoked by uid 99); 28 Oct 2015 09:34:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2015 09:34:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 96671E0441; Wed, 28 Oct 2015 09:34:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: onechiporenko@apache.org To: commits@ambari.apache.org Message-Id: <4f4aa77a28aa433abd5d85ece467ebb7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-13598. flume metrics show 0 numbers on the y axis even though the graph has data (onechiporenko) Date: Wed, 28 Oct 2015 09:34:09 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-2.1 d19c9859d -> b9b85ca9a AMBARI-13598. flume metrics show 0 numbers on the y axis even though the graph has data (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b9b85ca9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b9b85ca9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b9b85ca9 Branch: refs/heads/branch-2.1 Commit: b9b85ca9a2cdf3be14d006ffd424ea465132c7ce Parents: d19c985 Author: Oleg Nechiporenko Authored: Wed Oct 28 11:32:22 2015 +0200 Committer: Oleg Nechiporenko Committed: Wed Oct 28 11:32:22 2015 +0200 ---------------------------------------------------------------------- .../app/views/common/chart/linear_time.js | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b9b85ca9/ambari-web/app/views/common/chart/linear_time.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js index 22950e5..ccf26ac 100644 --- a/ambari-web/app/views/common/chart/linear_time.js +++ b/ambari-web/app/views/common/chart/linear_time.js @@ -511,6 +511,7 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, { var min = Number.MAX_VALUE; var max = Number.MIN_VALUE; var numberOfNotNullValues = 0; + series.isZero = true; for (var i = 0; i < series.data.length; i++) { avg += series.data[i]['y']; if (series.data[i]['y'] !== null) { @@ -524,15 +525,20 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, { if (series.data[i]['y'] > max) { max = series.data[i]['y']; } + if (series.data[i]['y'] > 1) { + series.isZero = false; + } + } + if (self.get('isPopup')) { + series.name = string_utils.pad(series.name.length > 36 ? series.name.substr(0, 36) + '...' : series.name, 40, ' ', 2) + '| ' + + string_utils.pad('min', 5, ' ', 3) + + string_utils.pad(self.get('yAxisFormatter')(min), 12, ' ', 3) + + string_utils.pad('avg', 5, ' ', 3) + + string_utils.pad(self.get('yAxisFormatter')(avg / numberOfNotNullValues), 12, ' ', 3) + + string_utils.pad('max', 12, ' ', 3) + + string_utils.pad(self.get('yAxisFormatter')(max), 5, ' ', 3); } - series.name = string_utils.pad(series.name.length > 36 ? series.name.substr(0, 36) + '...' : series.name, 40, ' ', 2) + '| ' + - string_utils.pad('min', 5, ' ', 3) + - string_utils.pad(self.get('yAxisFormatter')(min), 12, ' ', 3) + - string_utils.pad('avg', 5, ' ', 3) + - string_utils.pad(self.get('yAxisFormatter')(avg / numberOfNotNullValues), 12, ' ', 3) + - string_utils.pad('max', 12, ' ', 3) + - string_utils.pad(self.get('yAxisFormatter')(max), 5, ' ', 3); - if (min === max && 0 === min || max === Number.MIN_VALUE) { + if (series.isZero) { series.stroke = series.color; } if (series.data.length < series_min_length) { @@ -571,7 +577,8 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, { interpolation: 'step-after', stroke: true, renderer: this.get('renderer'), - strokeWidth: 'area' === this.get('renderer') ? 1 : 2 + strokeWidth: 'area' === this.get('renderer') ? 1 : 2, + max: seriesData.everyProperty('isZero') ? 1 : null }); if ('area' === this.get('renderer')) {