* @param cpd defines the connection
*/
private void doStatistics(ServletOutputStream out, StatisticsIF[] statisticsArray, ConnectionPoolDefinitionIF cpd) throws IOException {
for (int i = 0; i < statisticsArray.length; i++) {
StatisticsIF statistics = statisticsArray[i];
openDataTable(out);
printDefinitionEntry(out, ProxoolConstants.ALIAS, cpd.getAlias(), CORE_PROPERTY);
// Period
printDefinitionEntry(out, "Period", TIME_FORMAT.format(statistics.getStartDate()) + " to " + TIME_FORMAT.format(statistics.getStopDate()), STATISTIC);
// Served
printDefinitionEntry(out, "Served", statistics.getServedCount() + " (" + DECIMAL_FORMAT.format(statistics.getServedPerSecond()) + "/s)", STATISTIC);
// Refused
printDefinitionEntry(out, "Refused", statistics.getRefusedCount() + " (" + DECIMAL_FORMAT.format(statistics.getRefusedPerSecond()) + "/s)", STATISTIC);
// averageActiveTime
printDefinitionEntry(out, "Average active time", DECIMAL_FORMAT.format(statistics.getAverageActiveTime() / 1000) + "s", STATISTIC);
// activityLevel
StringBuffer activityLevelBuffer = new StringBuffer();
int activityLevel = (int) (100 * statistics.getAverageActiveCount() / cpd.getMaximumConnectionCount());
activityLevelBuffer.append(activityLevel);
activityLevelBuffer.append("%<br/>");
String[] colours = {"0000ff", "eeeeee"};
int[] lengths = {activityLevel, 100 - activityLevel};
drawBarChart(activityLevelBuffer, colours, lengths);