// add a stat and report to ZK
// perhaps should keep reporter per instance...
ParticipantHealthReportCollectorImpl reporter =
new ParticipantHealthReportCollectorImpl(manager, instance);
MockEspressoHealthReportProvider provider =
new MockEspressoHealthReportProvider();
reporter.addHealthReportProvider(provider);
String statName = "latency";
provider.setStat(_dbName, statName, "15");
reporter.transmitHealthReports();
// sleep long enough for first set of alerts to report and alert to get deleted
// then change reported data
try
{
Thread.sleep(10000);
}
catch (InterruptedException e)
{
System.err.println("Error sleeping");
}
provider.setStat(_dbName, statName, "1");
reporter.transmitHealthReports();
/*
* for (int i = 0; i < 5; i++) { accessor.setProperty(PropertyType.HEALTHREPORT,
* new ZNRecord("mockAlerts" + i), instance, "mockAlerts"); try {