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 2019/07/11 17:13:20 UTC

[incubator-pinot] branch master updated: [TE] detection health ui adjustments (#4421)

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 b6fe4e6  [TE] detection health ui adjustments (#4421)
b6fe4e6 is described below

commit b6fe4e64030b6331f02bfd3721c8e1943e662424
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Thu Jul 11 10:13:15 2019 -0700

    [TE] detection health ui adjustments (#4421)
    
    Make the metric explanation more accurate.
    Make "execution time" the latest task execution time to monitor the detection lag.
    Minor bug fixes
---
 .../app/pods/components/detection-health/component.js  | 11 +++++++----
 .../app/pods/components/detection-health/template.hbs  | 18 +++++++++---------
 .../thirdeye-frontend/app/pods/manage/explore/route.js |  2 --
 .../thirdeye-frontend/app/pods/manage/yaml/route.js    |  2 --
 4 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/thirdeye/thirdeye-frontend/app/pods/components/detection-health/component.js b/thirdeye/thirdeye-frontend/app/pods/components/detection-health/component.js
index 82c73aa..9af2ae0 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/detection-health/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/detection-health/component.js
@@ -14,8 +14,6 @@ import { get, computed } from '@ember/object';
 import floatToPercent from 'thirdeye-frontend/utils/float-to-percent';
 import moment from 'moment';
 
-const EXECUTION_TIME_FORMAT = 'MMM DD, YYYY - HH:mm:ss';
-
 export default Component.extend({
   selectedRule: null, // passed in by parent when relevant
   classNames: ['te-horizontal-cards__container'],
@@ -115,7 +113,11 @@ export default Component.extend({
     'health',
     function() {
       const health = get(this, 'health');
-      return `${moment(health.executionTime).format(EXECUTION_TIME_FORMAT)}`;
+      if (health.detectionTaskStatus.tasks.length != 0) {
+        const lastExecutionTime = new Date(health.detectionTaskStatus.tasks[0].endTime);
+        return lastExecutionTime.toDateString() + ", " +  lastExecutionTime.toLocaleTimeString() + " (" + moment().tz(moment.tz.guess()).format('z') + ")"
+      }
+      return "-"
     }
   ),
 
@@ -157,12 +159,13 @@ export default Component.extend({
       const info = {};
       info.mape = floatToPercent(NaN); // set default to Nan
       let rule = selectedRule ? selectedRule.detectorName : null;
+      info.status = 'Unknown'
       // 3 possibilities: selectedRule, no selectedRule and rules available, no rules available
       if (health && health.regressionStatus && typeof health.regressionStatus === 'object') {
         const regressionStatus = health.regressionStatus;
         info.status = statusMap[regressionStatus.healthStatus]; // default status will be overall regression status
         info.label = labelMap[regressionStatus.healthStatus];
-        if (typeof regressionStatus.detectorMapes === 'object' && typeof regressionStatus.detectorHealthStatus === 'object') {
+        if (typeof regressionStatus.detectorMapes === 'object' && typeof regressionStatus.detectorHealthStatus === 'object' && Object.keys(regressionStatus.detectorMapes).length != 0) {
           // There is a selectedRule
           if (rule) {
             info.mape = floatToPercent(regressionStatus.detectorMapes[rule]);
diff --git a/thirdeye/thirdeye-frontend/app/pods/components/detection-health/template.hbs b/thirdeye/thirdeye-frontend/app/pods/components/detection-health/template.hbs
index d221bb0..f2d2f3c 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/detection-health/template.hbs
+++ b/thirdeye/thirdeye-frontend/app/pods/components/detection-health/template.hbs
@@ -19,17 +19,17 @@
     {{#bs-popover placement="bottom" title="Detection health"}}
       <p>Overall health of the metrics that monitor detection performance.</p>
 
+      <label class="control-label te-label">
+        Detection task status
+      </label>
+
       <div class="te-horizontal-metrics__container">
         <ul class="te-horizontal-metrics__metric">
           <li class="te-horizontal-metrics__number">{{executionTime}}</li>
-          <li class="te-horizontal-metrics__title">Execution Time</li>
+          <li class="te-horizontal-metrics__title">Last Detection Task Finish Time</li>
         </ul>
       </div>
 
-      <label class="control-label te-label">
-        Detection task status
-      </label>
-
       <div class="te-horizontal-metrics__container">
         <ul class="te-horizontal-metrics__metric">
           <li class="te-horizontal-metrics__number{{detection.label}}">{{detection.status}}</li>
@@ -56,11 +56,11 @@
 
         <ul class="te-horizontal-metrics__metric">
           <li class="te-horizontal-metrics__number">{{anomalyCoverage.ratio}}%</li>
-          <li class="te-horizontal-metrics__title">Last 30 days</li>
+          <li class="te-horizontal-metrics__title">The percentage of anomalous duration over the past 30 days</li>
         </ul>
       </div>
 
-      <p>Adjust alert sensitivity using alert preview.</p>
+      <p>To improve this, adjust alert sensitivity using preview.</p>
 
       <label class="control-label te-label">
         Regression error{{#if regressionInfo.rule}} for {{regressionInfo.rule}}{{/if}}
@@ -74,11 +74,11 @@
 
         <ul class="te-horizontal-metrics__metric">
           <li class="te-horizontal-metrics__number">{{regressionInfo.mape}}%</li>
-          <li class="te-horizontal-metrics__title">Percentage of anomalies covered</li>
+          <li class="te-horizontal-metrics__title">The average prediction error (MAPE) of the baseline</li>
         </ul>
       </div>
 
-      <p>Tune the alert using preview.</p>
+      <p>To improve this, tune the detection rules using preview.</p>
     {{/bs-popover}}
   </a>
 </ul>
diff --git a/thirdeye/thirdeye-frontend/app/pods/manage/explore/route.js b/thirdeye/thirdeye-frontend/app/pods/manage/explore/route.js
index 9dc770e..5dceb3e 100644
--- a/thirdeye/thirdeye-frontend/app/pods/manage/explore/route.js
+++ b/thirdeye/thirdeye-frontend/app/pods/manage/explore/route.js
@@ -76,7 +76,6 @@ export default Route.extend(AuthenticatedRouteMixin, {
     }
 
     //detection health fetch
-    const executionTime = moment().valueOf(); // grab execution time
     const healthUrl = `/detection/health/${alertId}?start=${analysisRange[0]}&end=${analysisRange[1]}`;
     try {
       const health_result = await fetch(healthUrl, getProps);
@@ -85,7 +84,6 @@ export default Route.extend(AuthenticatedRouteMixin, {
       if (health_status !== 200) {
         notifications.error('Retrieval of detection health failed.', 'Error', toastOptions);
       } else {
-        health_json.executionTime = executionTime; // attach execution time for display
         set(this, 'detectionHealth', health_json);
       }
     } catch (error) {
diff --git a/thirdeye/thirdeye-frontend/app/pods/manage/yaml/route.js b/thirdeye/thirdeye-frontend/app/pods/manage/yaml/route.js
index b990418..0da0c00 100644
--- a/thirdeye/thirdeye-frontend/app/pods/manage/yaml/route.js
+++ b/thirdeye/thirdeye-frontend/app/pods/manage/yaml/route.js
@@ -63,7 +63,6 @@ export default Route.extend(AuthenticatedRouteMixin, {
     }
 
     //detection health fetch
-    const executionTime = moment().valueOf(); // grab execution time
     const healthUrl = `/detection/health/${alertId}?start=${analysisRange[0]}&end=${analysisRange[1]}`;
     try {
       const health_result = await fetch(healthUrl, getProps);
@@ -72,7 +71,6 @@ export default Route.extend(AuthenticatedRouteMixin, {
       if (health_status !== 200) {
         notifications.error('Retrieval of detection health failed.', 'Error', toastOptions);
       } else {
-        health_json.executionTime = executionTime; // attach execution time for display
         set(this, 'detectionHealth', health_json);
       }
     } catch (error) {


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