use of com.microsoft.dhalion.core.Symptom in project heron by twitter.
the class SlowInstanceDiagnoserTest method failsIfNoBufferSizeDisparity.
@Test
public void failsIfNoBufferSizeDisparity() {
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());
}
use of com.microsoft.dhalion.core.Symptom in project heron by twitter.
the class SlowInstanceDiagnoserTest method diagnosis1of3SlowInstances.
@Test
public void diagnosis1of3SlowInstances() {
addMeasurements(METRIC_BACK_PRESSURE, 123, 0, 0);
addMeasurements(METRIC_WAIT_Q_SIZE, 1000, 20, 20);
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 qDisparitySymptom = new Symptom(SYMPTOM_WAIT_Q_SIZE_SKEW.text(), now, assign);
Collection<Symptom> symptoms = Arrays.asList(bpSymptom, qDisparitySymptom);
Collection<Diagnosis> result = diagnoser.diagnose(symptoms);
assertEquals(1, result.size());
Diagnosis diagnoses = result.iterator().next();
assertEquals(DIAGNOSIS_SLOW_INSTANCE.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.Symptom 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.Symptom 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.Symptom 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());
}
Aggregations