FileOutputStream fileOut = new FileOutputStream(statsFile);
statsWriter = new PrintWriter(fileOut, true);
statsWriter.println(localConnector.getComponentNameSpace().getName() + ":");
statsWriter.println("inboundExchanges,inboundExchangeRate,outboundExchanges,outboundExchangeRate");
}
MessagingStats stats = localConnector.getMessagingStats();
long inbound = stats.getInboundExchanges().getCount();
double inboundRate = stats.getInboundExchangeRate().getAveragePerSecond();
long outbound = stats.getOutboundExchanges().getCount();
double outboundRate = stats.getOutboundExchangeRate().getAveragePerSecond();
statsWriter.println(inbound + "," + inboundRate + "," + outbound + "," + outboundRate);
}
catch (IOException e) {
log.warn("Failed to dump stats", e);
}