private void collectDataAndReport() {
if (log.isDebugEnabled()) {
log.trace("Starting new mediation statistics collection cycle");
}
StatisticsCollector statisticsCollector =
synapseEnvironmentService.getSynapseEnvironment().getStatisticsCollector();
if (statisticsCollector == null) {
if (log.isDebugEnabled()) {
log.debug("Statistics collector is not available in the Synapse environment");
}
delay();
return;
}
List<StatisticsRecord> records =
statisticsCollector.getAndClearStatisticsRecords();
if (records == null || records.size() == 0) {
// If no records are collected take a nap and try again later
delay();
return;
}