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 581a04a  [TE] harleyjj/preview - make default time range 1 day for 
preview (#3931)
581a04a is described below

commit 581a04a58ed678b7f6d2d4194e7515b26e821bcc
Author: Harley Jackson <harleyy...@gmail.com>
AuthorDate: Thu Mar 7 15:40:19 2019 -0800

    [TE] harleyjj/preview - make default time range 1 day for preview (#3931)
---
 .../app/pods/components/alert-details/component.js       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 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 297acbf..495cae3 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -39,7 +39,7 @@ const TIME_PICKER_INCREMENT = 5; // tells date picker hours 
field how granularly
 const DEFAULT_ACTIVE_DURATION = '1m'; // setting this date range selection as 
default (Last 24 Hours)
 const UI_DATE_FORMAT = 'MMM D, YYYY hh:mm a'; // format for date picker to use 
(usually varies by route or metric)
 const DISPLAY_DATE_FORMAT = 'YYYY-MM-DD HH:mm'; // format used consistently 
across app to display custom date range
-const TIME_RANGE_OPTIONS = ['1w', '1m', '3m'];
+const TIME_RANGE_OPTIONS = ['1d', '1w', '1m', '3m'];
 const ANOMALY_LEGEND_THRESHOLD = 20; // If number of anomalies is larger than 
this threshold, don't show the legend
 
 export default Component.extend({
@@ -48,7 +48,7 @@ export default Component.extend({
   anomalyMapping: {},
   timeseries: null,
   isLoading: false,
-  analysisRange: [moment().add(1, 'day').startOf('day').subtract(1, 
'week').valueOf(), moment().add(1, 'day').startOf('day').valueOf()],
+  analysisRange: [moment().subtract(1, 'day').startOf('day').valueOf(), 
moment().startOf('day').valueOf()],
   isPendingData: false,
   colorMapping: colorMapping,
   zoom: {
@@ -482,10 +482,12 @@ export default Component.extend({
     try {
       if(isPreviewMode){
         applicationAnomalies = yield getYamlPreviewAnomalies(alertYaml, start, 
end);
-        metricUrnList = Object.keys(applicationAnomalies.diagnostics['0']);
-        set(this, 'metricUrnList', metricUrnList);
-        set(this, 'selectedDimension', 
toMetricLabel(extractTail(decodeURIComponent(metricUrnList[0]))));
-        set(this, 'metricUrn', metricUrnList[0]);
+        if (applicationAnomalies && applicationAnomalies.diagnostics && 
applicationAnomalies.diagnostics['0']) {
+          metricUrnList = Object.keys(applicationAnomalies.diagnostics['0']);
+          set(this, 'metricUrnList', metricUrnList);
+          set(this, 'selectedDimension', 
toMetricLabel(extractTail(decodeURIComponent(metricUrnList[0]))));
+          set(this, 'metricUrn', metricUrnList[0]);
+        }
         anomalies = applicationAnomalies.anomalies;
       } else {
         applicationAnomalies = yield getAnomaliesByAlertId(alertId, start, 
end);
@@ -539,7 +541,7 @@ export default Component.extend({
       set(this, 'selectedDimension', 'Choose a dimension');
       this._fetchAnomalies();
     } else {
-      set(this, 'duration', '1w');
+      set(this, 'duration', '1d');
     }
   },
 


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

Reply via email to