Example #1
0
    function() {
      const anomaliesRange = get(this, 'anomaliesRange');
      const startDate = Number(anomaliesRange[0]);
      const endDate = Number(anomaliesRange[1]);
      const duration = get(this, 'duration') || DEFAULT_ACTIVE_DURATION;
      const predefinedRanges = {
        'Today': [moment().startOf('day'), moment().startOf('day').add(1, 'days')],
        'Last 24 hours': [moment().subtract(1, 'day'), moment()],
        'Yesterday': [moment().subtract(1, 'day').startOf('day'), moment().startOf('day')],
        'Last Week': [moment().subtract(1, 'week').startOf('day'), moment().startOf('day')]
      };

      return {
        uiDateFormat: UI_DATE_FORMAT,
        activeRangeStart: moment(startDate).format(DISPLAY_DATE_FORMAT),
        activeRangeEnd: moment(endDate).format(DISPLAY_DATE_FORMAT),
        timeRangeOptions: setUpTimeRangeOptions(TIME_RANGE_OPTIONS, duration),
        timePickerIncrement: TIME_PICKER_INCREMENT,
        predefinedRanges
      };
    }
Example #2
0
    controller.setProperties({
      alertData,
      loadError,
      patternMap,
      severityMap,
      alertId: id,
      autoTuneId: '',
      customMttdChange,
      customPercentChange,
      alertEvalMetrics,
      selectedTunePattern,
      selectedSeverityOption,
      mttdMinimums: sensitivityDefaults.mttdGranularityMinimums,
      alertHasDimensions: isPresent(alertData.exploreDimensions),
      timeRangeOptions: setUpTimeRangeOptions([durationDefault], duration)
    });
    controller.initialize();

    // Ensure date range picker gets populated correctly
    later(this, () => {
      controller.setProperties({
        activeRangeStart: moment(Number(startDate)).format(displayDateFormat),
        activeRangeEnd: moment(Number(endDate)).format(displayDateFormat)
      });
    });
  },

  resetController(controller, isExiting) {
    this._super(...arguments);
Example #3
0
     * Sets the new custom date range for anomaly coverage
     * @method onRangeSelection
     * @param {Object} rangeOption - the user-selected time range to load
     */
    onRangeSelection(timeRangeOptions) {
      const {
        start,
        end,
        value: duration
      } = timeRangeOptions;

      const startDate = moment(start).valueOf();
      const endDate = moment(end).valueOf();
      const appName = get(this, 'appName');
      //Update the time range option selected
      this.set('timeRangeOptions', setUpTimeRangeOptions(TIME_RANGE_OPTIONS, duration));
      this.transitionToRoute({ queryParams: { appName, duration, startDate, endDate }});
    },

    /**
     * Handle dynamically saving anomaly feedback responses
     * @method onFilterBy
     * @param {String} feedbackType - the current feedback type
     * @param {String} selected - the selection item
     */
    onFilterBy(feedbackType, selected) {
      const feedbackItem = this._checkFeedback(selected);
      set(this, 'feedbackType', feedbackItem.name);
    },

    /**
Example #4
0
      loadError,
      jobId,
      alertData,
      alertId: id,
      DEFAULT_SEVERITY,
      totalAnomalies,
      anomalyDataUrl,
      baselineOptions,
      alertEvalMetrics,
      anomaliesLoaded: false,
      isMetricDataInvalid: false,
      isMetricDataLoading: true,
      alertDimension: exploreDimensions,
      isReplayPending: isPresent(jobId) && jobId !== -1,
      alertHasDimensions: isPresent(exploreDimensions),
      timeRangeOptions: setUpTimeRangeOptions(['3m'], duration),
      baselineOptionsLoading: anomalyIds && anomalyIds.length > 0,
      responseOptions: anomalyResponseObj.map(response => response.name)
    });
    // Kick off controller defaults and replay status check
    controller.initialize();

    // Ensure date range picker gets populated correctly
    later(this, () => {
      controller.setProperties({
        activeRangeStart: moment(config.startStamp).format(displayDateFormat),
        activeRangeEnd: moment(config.endStamp).format(displayDateFormat)
      });
    });

    // Once replay is finished, begin loading anomaly and graph data as concurrency tasks