akshayrai 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_r271005342
 
 

 ##########
 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:
   I am not sure if showing 0 is ideal. Can we display "unable to fetch" or 
some similar text in the UI?
   
   Do you know why we have Infinity? Is the backend returning this?

----------------------------------------------------------------
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