xiaohui-sun commented on a change in pull request #4043: [TE] frontend - 
harleyjj/alert-overview - handle infinity value in an…
URL: https://github.com/apache/incubator-pinot/pull/4043#discussion_r271008016
 
 

 ##########
 File path: 
thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
 ##########
 @@ -372,16 +372,16 @@ 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,
             start: a.startTime,
             end: a.endTime,
             startDateStr: this._formatAnomaly(a),
             durationStr: getFormattedDuration(a.startTime, a.endTime),
-            shownCurrent: humanizeFloat(a.avgCurrentVal),
 
 Review comment:
   E.g, for rule based detection if the previous value is 0 then the change 
would be infinity. @harleyjj  is it possible to show it as "n/a" or "-"?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to