Search in sources :

Example 1 with AnomalyFeedbackType

use of com.linkedin.thirdeye.constant.AnomalyFeedbackType in project pinot by linkedin.

the class AlertFilterEvaluationUtil method updateFeedbackSummary.

/**
   * Provide feedback summary give a list of merged anomalies
   * @param anomalies
   */
public void updateFeedbackSummary(List<MergedAnomalyResultDTO> anomalies) {
    int totalAnomalies = 0;
    int totalResponses = 0;
    int trueAnomalies = 0;
    int falseAlarm = 0;
    int nonActionable = 0;
    for (MergedAnomalyResultDTO anomaly : anomalies) {
        totalAnomalies++;
        // evaluate feedbacks
        AnomalyFeedbackDTO feedback = anomaly.getFeedback();
        if (feedback != null) {
            totalResponses++;
            AnomalyFeedbackType feedbackType = feedback.getFeedbackType();
            switch(feedbackType) {
                case ANOMALY:
                    trueAnomalies++;
                    break;
                case ANOMALY_NO_ACTION:
                    nonActionable++;
                    break;
                case NOT_ANOMALY:
                    falseAlarm++;
                    break;
            }
        }
    }
    this.totalAnomalies = totalAnomalies;
    this.totalResponses = totalResponses;
    this.trueAnomalies = trueAnomalies;
    this.falseAlarm = falseAlarm;
    this.nonActionable = nonActionable;
}
Also used : MergedAnomalyResultDTO(com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO) AnomalyFeedbackType(com.linkedin.thirdeye.constant.AnomalyFeedbackType) AnomalyFeedbackDTO(com.linkedin.thirdeye.datalayer.dto.AnomalyFeedbackDTO)

Aggregations

AnomalyFeedbackType (com.linkedin.thirdeye.constant.AnomalyFeedbackType)1 AnomalyFeedbackDTO (com.linkedin.thirdeye.datalayer.dto.AnomalyFeedbackDTO)1 MergedAnomalyResultDTO (com.linkedin.thirdeye.datalayer.dto.MergedAnomalyResultDTO)1