You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2020/09/17 22:23:22 UTC

[incubator-pinot] branch master updated: [TE] UI - add severity level in the anomaly table (#6025)

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

jihao 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 348da46  [TE] UI - add severity level in the anomaly table (#6025)
348da46 is described below

commit 348da4669b8491b4687ffd0953d38e30cd68438a
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Thu Sep 17 15:23:07 2020 -0700

    [TE] UI - add severity level in the anomaly table (#6025)
    
    This PR adds severity level into the anomaly table in the alerts page and the preview page.
---
 .../app/pods/components/alert-details/component.js        |  7 +++++++
 .../custom/anomalies-table/severity-level/template.hbs    |  1 +
 .../app/pods/services/api/anomalies/service.js            |  7 ++++++-
 thirdeye/thirdeye-frontend/app/utils/anomaly.js           | 15 ++++++++++++++-
 4 files changed, 28 insertions(+), 2 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 3caaea4..8d077a6 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -646,6 +646,7 @@ export default Component.extend({
           set(a, 'start', a.startTime);
           set(a, 'end', a.endTime);
           set(a, 'feedback', a.feedback ? a.feedback.feedbackType : a.statusClassification);
+          set(a, 'severityLabel', a.severityLabel);
           if (a.feedback === 'NONE') {
             set(a, 'feedback', 'NO_FEEDBACK');
           }
@@ -674,6 +675,8 @@ export default Component.extend({
           set(a, 'start', a.startTime);
           set(a, 'end', a.endTime);
           set(a, 'feedback', a.feedback ? a.feedback.feedbackType : a.statusClassification);
+          set(a, 'severityLabel', a.severityLabel);
+
           if (a.feedback === 'NONE') {
             set(a, 'feedback', 'NO_FEEDBACK');
           }
@@ -747,6 +750,10 @@ export default Component.extend({
         component: 'custom/anomalies-table/rule',
         propertyName: 'rule',
         title: 'Rule'
+      }, {
+        component: 'custom/anomalies-table/severity-level',
+        propertyName: 'severityLabel',
+        title: 'Severity Level'
       }];
       const rightmostColumns = isPreviewMode ? [] : [{
         component: 'custom/anomalies-table/resolution',
diff --git a/thirdeye/thirdeye-frontend/app/pods/custom/anomalies-table/severity-level/template.hbs b/thirdeye/thirdeye-frontend/app/pods/custom/anomalies-table/severity-level/template.hbs
new file mode 100644
index 0000000..6718b33
--- /dev/null
+++ b/thirdeye/thirdeye-frontend/app/pods/custom/anomalies-table/severity-level/template.hbs
@@ -0,0 +1 @@
+{{record.severityLabel}}
diff --git a/thirdeye/thirdeye-frontend/app/pods/services/api/anomalies/service.js b/thirdeye/thirdeye-frontend/app/pods/services/api/anomalies/service.js
index 224179c..6c4b3ed 100644
--- a/thirdeye/thirdeye-frontend/app/pods/services/api/anomalies/service.js
+++ b/thirdeye/thirdeye-frontend/app/pods/services/api/anomalies/service.js
@@ -6,7 +6,8 @@ import { humanizeFloat, humanizeChange } from 'thirdeye-frontend/utils/utils';
 import floatToPercent from 'thirdeye-frontend/utils/float-to-percent';
 import {
   getFormattedDuration,
-  anomalyResponseObjNew
+  anomalyResponseObjNew,
+  anomalySeverityLevelObj
 } from 'thirdeye-frontend/utils/anomaly';
 
 const HumanizedAnomaly = EmberObject.extend({// ex: record.humanizedChangeDisplay (humanized), record.anomaly.start (raw)
@@ -48,6 +49,10 @@ const HumanizedAnomaly = EmberObject.extend({// ex: record.humanizedChangeDispla
   start: computed.alias('anomaly.start'),
   settings: computed.alias('anomaly.settings'),
   settingsNum: computed.alias('anomaly.settingsNum'),
+  severityLabel: computed('anomaly.severityLabel', function () {
+    return get(this, 'anomaly.severityLabel') ? anomalySeverityLevelObj.find(
+      res => res.value == get(this, 'anomaly.severityLabel')).name : 'Default'
+  }),
   anomalyFeedback: computed('anomaly.feedback', function() {
     return get(this, 'anomaly.feedback') ? anomalyResponseObjNew.find(res => res.value === get(this, 'anomaly.feedback')).name : '';
   }),
diff --git a/thirdeye/thirdeye-frontend/app/utils/anomaly.js b/thirdeye/thirdeye-frontend/app/utils/anomaly.js
index 3a2542b..d50db0e 100644
--- a/thirdeye/thirdeye-frontend/app/utils/anomaly.js
+++ b/thirdeye/thirdeye-frontend/app/utils/anomaly.js
@@ -79,6 +79,18 @@ export const anomalyResponseObjNew = [
   }
 ];
 
+export const anomalySeverityLevelObj = [{
+  name: 'Default', value: 'DEFAULT'
+}, {
+  name: 'Low', value: 'LOW'
+}, {
+  name: 'Medium', value: 'MEDIUM'
+}, {
+  name: 'High', value: 'HIGH'
+}, {
+  name: 'Critical', value: 'CRITICAL'
+}]
+
 export const anomalyTypeMapping = {
   "DEVIATION": "Metric Deviation", "TREND_CHANGE": "Trend Change", "DATA_SLA": "SLA Violation"
 }
@@ -305,5 +317,6 @@ export default {
   getBounds,
   searchAnomaly,
   searchAnomalyWithFilters,
-  anomalyTypeMapping
+  anomalyTypeMapping,
+  anomalySeverityLevelObj
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org