use of com.microsoft.dhalion.core.Diagnosis in project heron by twitter.
the class DataSkewDiagnoserTest method diagnosisNoDataSkewLowRate.
@Test
public void diagnosisNoDataSkewLowRate() {
addMeasurements(METRIC_BACK_PRESSURE, 123, 0, 0);
addMeasurements(METRIC_EXE_COUNT, 100, 2000, 2000);
addMeasurements(METRIC_WAIT_Q_SIZE, 10000, 500, 500);
when(context.measurements()).thenReturn(MeasurementsTable.of(measurements));
Collection<String> assign = Collections.singleton(comp);
Symptom bpSymptom = new Symptom(SYMPTOM_COMP_BACK_PRESSURE.text(), now, assign);
Symptom skewSymptom = new Symptom(SYMPTOM_PROCESSING_RATE_SKEW.text(), now, assign);
Symptom qDisparitySymptom = new Symptom(SYMPTOM_WAIT_Q_SIZE_SKEW.text(), now, assign);
Collection<Symptom> symptoms = Arrays.asList(bpSymptom, skewSymptom, qDisparitySymptom);
Collection<Diagnosis> result = diagnoser.diagnose(symptoms);
assertEquals(0, result.size());
}
use of com.microsoft.dhalion.core.Diagnosis in project heron by twitter.
the class DataSkewDiagnoserTest method diagnosis1DataSkewInstance.
@Test
public void diagnosis1DataSkewInstance() {
addMeasurements(METRIC_BACK_PRESSURE, 123, 0, 0);
addMeasurements(METRIC_EXE_COUNT, 5000, 2000, 2000);
addMeasurements(METRIC_WAIT_Q_SIZE, 10000, 500, 500);
when(context.measurements()).thenReturn(MeasurementsTable.of(measurements));
Collection<String> assign = Collections.singleton(comp);
Symptom bpSymptom = new Symptom(SYMPTOM_COMP_BACK_PRESSURE.text(), now, assign);
Symptom skewSymptom = new Symptom(SYMPTOM_PROCESSING_RATE_SKEW.text(), now, assign);
Symptom qDisparitySymptom = new Symptom(SYMPTOM_WAIT_Q_SIZE_SKEW.text(), now, assign);
Collection<Symptom> symptoms = Arrays.asList(bpSymptom, skewSymptom, qDisparitySymptom);
Collection<Diagnosis> result = diagnoser.diagnose(symptoms);
assertEquals(1, result.size());
Diagnosis diagnoses = result.iterator().next();
assertEquals(DIAGNOSIS_DATA_SKEW.text(), diagnoses.type());
assertEquals(1, diagnoses.assignments().size());
assertEquals("i1", diagnoses.assignments().iterator().next());
// TODO
// assertEquals(1, diagnoses.symptoms().size());
}
use of com.microsoft.dhalion.core.Diagnosis in project heron by twitter.
the class DataSkewDiagnoserTest method diagnosisNoDataSkewLowBufferSize.
@Test
public void diagnosisNoDataSkewLowBufferSize() {
addMeasurements(METRIC_BACK_PRESSURE, 123, 0, 0);
addMeasurements(METRIC_EXE_COUNT, 5000, 2000, 2000);
addMeasurements(METRIC_WAIT_Q_SIZE, 1, 500, 500);
when(context.measurements()).thenReturn(MeasurementsTable.of(measurements));
Collection<String> assign = Collections.singleton(comp);
Symptom bpSymptom = new Symptom(SYMPTOM_COMP_BACK_PRESSURE.text(), now, assign);
Symptom skewSymptom = new Symptom(SYMPTOM_PROCESSING_RATE_SKEW.text(), now, assign);
Symptom qDisparitySymptom = new Symptom(SYMPTOM_WAIT_Q_SIZE_SKEW.text(), now, assign);
Collection<Symptom> symptoms = Arrays.asList(bpSymptom, skewSymptom, qDisparitySymptom);
Collection<Diagnosis> result = diagnoser.diagnose(symptoms);
assertEquals(0, result.size());
}
use of com.microsoft.dhalion.core.Diagnosis in project heron by twitter.
the class UnderProvisioningDiagnoserTest method validateDiagnosis.
private void validateDiagnosis(Collection<Diagnosis> result) {
assertEquals(1, result.size());
Diagnosis diagnoses = result.iterator().next();
assertEquals(DIAGNOSIS_UNDER_PROVISIONING.text(), diagnoses.type());
assertEquals(1, diagnoses.assignments().size());
assertEquals(comp, diagnoses.assignments().iterator().next());
// TODO
// Assert.assertEquals(1, result.getSymptoms().size());
}
use of com.microsoft.dhalion.core.Diagnosis in project heron by twitter.
the class DataSkewDiagnoserTest method failsIfNoDataSkewSymptom.
@Test
public void failsIfNoDataSkewSymptom() {
Symptom symptom = new Symptom(SYMPTOM_COMP_BACK_PRESSURE.text(), Instant.now(), null);
Collection<Symptom> symptoms = Collections.singletonList(symptom);
Collection<Diagnosis> result = diagnoser.diagnose(symptoms);
assertEquals(0, result.size());
}
Aggregations