This is an automated email from the ASF dual-hosted git repository.

xhsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 55839b4  [TE] frontend - harleyjj/alert-overview - handle infinity 
value in anomalies (#4043)
55839b4 is described below

commit 55839b446691139625f702093ffaf1ec6851e6fc
Author: Harley Jackson <[email protected]>
AuthorDate: Mon Apr 1 11:36:31 2019 -0700

    [TE] frontend - harleyjj/alert-overview - handle infinity value in 
anomalies (#4043)
---
 .../app/pods/components/alert-details/component.js                  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js 
b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
index 978eb61..abcc8ad 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -372,7 +372,7 @@ export default Component.extend({
 
       if (anomalies) {
         anomalies.forEach(a => {
-          const change = (a.avgBaselineVal !== 0) ? 
(a.avgCurrentVal/a.avgBaselineVal - 1.0) * 100.0 : 0;
+          const change = (a.avgBaselineVal !== 0 && a.avgBaselineVal !== 
"Infinity" && a.avgCurrentVal !== "Infinity") ? 
(a.avgCurrentVal/a.avgBaselineVal - 1.0) * 100.0 : 0;
           let tableRow = {
             anomalyId: a.id,
             metricUrn: a.metricUrn,
@@ -380,8 +380,8 @@ export default Component.extend({
             end: a.endTime,
             startDateStr: this._formatAnomaly(a),
             durationStr: getFormattedDuration(a.startTime, a.endTime),
-            shownCurrent: humanizeFloat(a.avgCurrentVal),
-            shownBaseline: humanizeFloat(a.avgBaselineVal),
+            shownCurrent: a.avgCurrentVal === "Infinity" ? 0 : 
humanizeFloat(a.avgCurrentVal),
+            shownBaseline: a.avgBaselineVal === "Infinity" ? 0 : 
humanizeFloat(a.avgBaselineVal),
             change: change,
             shownChangeRate: humanizeFloat(change),
             anomalyFeedback: a.feedback ? a.feedback.feedbackType : 
a.statusClassification,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to