EventingConfigData eventingConfigData = StatisticsServiceComponent.getServiceStatisticsPublisherAdmin()
.getEventingConfigData();
if (eventingConfigData != null && eventingConfigData.eventingEnabled()
&& eventingConfigData.getSystemRequestCountThreshold() > 0) {
SystemStatistics systemStatistics = systemStatisticsUtil.getSystemStatistics(msgContext
.getConfigurationContext().getAxisConfiguration());
if (msgContext.getAxisOperation() != null) {
OperationStatistics operationStatistics = systemStatisticsUtil.getOperationStatistics(
msgContext.getAxisOperation());
if (operationStatistics.getRequestCount() == 0) {
return InvocationResponse.CONTINUE;
}
}//In very rare cases msgContext.getAxisOperation() becomes null, then we can't get statistics.
else {
return InvocationResponse.CONTINUE;
}
Collection<ServiceStatisticData> latestServiceStats = updateAndGetLatestServiceStatistics(
systemStatisticsUtil,
countData,
msgContext);
Collection<OperationStatisticData> latestOperationStats = updateAndGetLatestOperationStatistics(
systemStatisticsUtil,
countData,
msgContext);
int lastCount = countData.getSystemCount();
// Current hit count for system
int currentCount = systemStatistics.getRequestCount();
if (currentCount - lastCount > eventingConfigData.getSystemRequestCountThreshold()) {
countData.setSystemCount(currentCount);