[TE] frontend - harleyjj/alert-overview - handle infinity value in anomalies
@@ -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,
