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

xhsun 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 b2c8aed  [TE] frontend - harleyjj/preview - restrict time range for 
yaml/preview to present (#4044)
b2c8aed is described below

commit b2c8aed5f3861cb005960529d14f63e9fe255166
Author: Harley Jackson <[email protected]>
AuthorDate: Tue Apr 2 09:53:28 2019 -0700

    [TE] frontend - harleyjj/preview - restrict time range for yaml/preview to 
present (#4044)
---
 .../app/pods/components/alert-details/component.js | 24 ++++++++++++++++++++--
 1 file changed, 22 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 abcc8ad..e07db99 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -122,6 +122,23 @@ export default Component.extend({
     }),
 
   /**
+   * Separate time range for anomalies in preview mode
+   * @type {Array}
+   */
+  anomaliesRange: computed(
+    'analysisRange',
+    function() {
+      const analysisRange = get(this, 'analysisRange');
+      let range = [];
+      range.push(analysisRange[0]);
+      // set end to now if the end time is in the future
+      const end = Math.min(moment().valueOf(), analysisRange[1]);
+      range.push(end)
+      return range;
+    }
+  ),
+
+  /**
    * Whether the alert has multiple dimensions
    * @type {Boolean}
    */
@@ -493,19 +510,22 @@ export default Component.extend({
     let anomalyMapping = {};
     const {
       analysisRange,
+      anomaliesRange,
       notifications,
       isPreviewMode,
       alertId
-    } = this.getProperties('analysisRange', 'notifications', 'isPreviewMode', 
'alertId');
+    } = this.getProperties('analysisRange', 'anomaliesRange', 'notifications', 
'isPreviewMode', 'alertId');
     //detection alert fetch
     const start = analysisRange[0];
     const end = analysisRange[1];
+    const startAnomalies = anomaliesRange[0];
+    const endAnomalies = anomaliesRange[1];
     let anomalies;
     let applicationAnomalies;
     let metricUrnList;
     try {
       if(isPreviewMode){
-        applicationAnomalies = yield getYamlPreviewAnomalies(alertYaml, start, 
end, alertId);
+        applicationAnomalies = yield getYamlPreviewAnomalies(alertYaml, 
startAnomalies, endAnomalies, alertId);
         if (applicationAnomalies && applicationAnomalies.diagnostics && 
applicationAnomalies.diagnostics['0']) {
           metricUrnList = Object.keys(applicationAnomalies.diagnostics['0']);
           set(this, 'metricUrnList', metricUrnList);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to