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;
}
Aggregations