@@ -0,0 +1,1277 @@
+package com.linkedin.thirdeye.detector.email.filter;%0A%0Aimport com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0A/**%0A * The filter remove the anomalies whose average current value does not increase over its average baseline value by%0A * the threshold, i.e., only anomalies whose (avg. current - avg. baseline %3E threshold) pass the filter.%0A */%0Apublic class AverageChangeThresholdAlertFilter extends BaseAlertFilter %7B%0A  // These default parameters are accessed through Java reflection. Do not remove.%0A  public static final String DEFAULT_THRESHOLD = %22100%22;%0A%0A  public static final String THRESHOLD = %22threshold%22;%0A%0A  private double threshold = Double.parseDouble(DEFAULT_THRESHOLD);%0A%0A  @Override%0A  public List%3CString%3E getPropertyNames() %7B%0A    return Collections.unmodifiableList(new ArrayList%3C%3E(Arrays.asList(THRESHOLD)));%0A  %7D%0A%0A  public double getThreshold() %7B%0A    return threshold;%0A  %7D%0A%0A  @Override%0A  public boolean isQualified(MergedAnomalyResultDTO anomaly) %7B%0A    double averageCurrent = anomaly.getAvgCurrentVal();%0A    double averageBaseline = anomaly.getAvgBaselineVal();%0A    double diff = averageCurrent - averageBaseline;%0A%0A    return (diff %3E threshold);%0A  %7D%0A%7D%0A

Add average change threshold alert filter (#1337)