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/16 21:33:05 UTC

[incubator-pinot] branch severity-level-ui created (now df72056)

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

jihao pushed a change to branch severity-level-ui
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at df72056  [TE] UI - add severity level in the anomaly table

This branch includes the following new commits:

     new df72056  [TE] UI - add severity level in the anomaly table

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-pinot] 01/01: [TE] UI - add severity level in the anomaly table

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jihao pushed a commit to branch severity-level-ui
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit df7205630bafb15908112a1e5102b838d3062c95
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Wed Sep 16 14:32:14 2020 -0700

    [TE] UI - add severity level in the anomaly table
---
 .../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 ba665e4..e0aa2d4 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