use of com.microsoft.dhalion.core.Diagnosis in project heron by twitter.
the class UnderProvisioningDiagnoser method diagnose.
@Override
public Collection<Diagnosis> diagnose(Collection<Symptom> symptoms) {
Collection<Diagnosis> diagnoses = new ArrayList<>();
SymptomsTable symptomsTable = SymptomsTable.of(symptoms);
SymptomsTable bp = symptomsTable.type(SYMPTOM_COMP_BACK_PRESSURE.text());
if (bp.size() > 1) {
// TODO handle cases where multiple detectors create back pressure symptom
throw new IllegalStateException("Multiple back-pressure symptoms case");
}
if (bp.size() == 0) {
return diagnoses;
}
String bpComponent = bp.first().assignments().iterator().next();
SymptomsTable processingRateSkew = symptomsTable.type(SYMPTOM_PROCESSING_RATE_SKEW.text());
SymptomsTable waitQSkew = symptomsTable.type(SYMPTOM_WAIT_Q_SIZE_SKEW.text());
if (waitQSkew.assignment(bpComponent).size() != 0 || processingRateSkew.assignment(bpComponent).size() != 0) {
return diagnoses;
}
Collection<String> assignments = Collections.singletonList(bpComponent);
LOG.info(String.format("UNDER_PROVISIONING: %s back-pressure and similar processing rates " + "and wait queue sizes", bpComponent));
diagnoses.add(new Diagnosis(DIAGNOSIS_UNDER_PROVISIONING.text(), context.checkpoint(), assignments));
return diagnoses;
}
Aggregations