WebManager manager = managers[0]; //todo: handle multiple
WebContainer[] containers = (WebContainer[]) manager.getContainers();
if (containers != null) {
WebContainer container = containers[0]; //todo: handle multiple
if(container.isStatisticsProvider()) {
WebContainerStats webStats = (WebContainerStats) ((StatisticsProvider)container).getStats();
if (webStats.isStatsOn()) {
renderRequest.setAttribute("statsOn", Boolean.TRUE);
renderRequest.setAttribute("totalRequestCount", new Long(webStats.getTotalRequestCount().getCount()));
renderRequest.setAttribute("totalConnectionCount", new Long(webStats.getTotalConnectionCount().getCount()));
renderRequest.setAttribute("totalErrorCount", new Long(webStats.getTotalErrorCount().getCount()));
renderRequest.setAttribute("activeRequestCountCurrent", new Long(webStats.getActiveRequestCount().getCurrent()));
renderRequest.setAttribute("activeRequestCountLow", new Long(webStats.getActiveRequestCount().getLowWaterMark()));
renderRequest.setAttribute("activeRequestCountHigh", new Long(webStats.getActiveRequestCount().getHighWaterMark()));
renderRequest.setAttribute("connectionRequestCountCurrent", new Long(webStats.getConnectionRequestCount().getCurrent()));
renderRequest.setAttribute("connectionRequestCountLow", new Long(webStats.getConnectionRequestCount().getLowWaterMark()));
renderRequest.setAttribute("connectionRequestCountHigh", new Long(webStats.getConnectionRequestCount().getHighWaterMark()));
// renderRequest.setAttribute("connectionRequestsAve", new Long(0)); /* Can't really compute this for a range ... do we still need it (from old portlet) */
renderRequest.setAttribute("openConnectionCountCurrent", new Long(webStats.getOpenConnectionCount().getCurrent()));
renderRequest.setAttribute("openConnectionCountLow", new Long(webStats.getOpenConnectionCount().getLowWaterMark()));
renderRequest.setAttribute("openConnectionCountHigh", new Long(webStats.getOpenConnectionCount().getHighWaterMark()));
renderRequest.setAttribute("requestDurationCount", new Long(webStats.getRequestDuration().getCount()));
renderRequest.setAttribute("requestDurationMinTime", new Long(webStats.getRequestDuration().getMinTime()));
renderRequest.setAttribute("requestDurationMaxTime", new Long(webStats.getRequestDuration().getMaxTime()));
renderRequest.setAttribute("requestDurationTotalTime", new Long(webStats.getRequestDuration().getTotalTime()));
// renderRequest.setAttribute("requestDurationAve", new Long(0)); /* Would this be valuable to calculate? We used to show this in the old jetty only portlet */
renderRequest.setAttribute("connectionDurationCount", new Long(webStats.getConnectionDuration().getCount()));
renderRequest.setAttribute("connectionDurationMinTime", new Long(webStats.getConnectionDuration().getMinTime()));
renderRequest.setAttribute("connectionDurationMaxTime", new Long(webStats.getConnectionDuration().getMaxTime()));
renderRequest.setAttribute("connectionDurationTotalTime", new Long(webStats.getConnectionDuration().getTotalTime()));
// renderRequest.setAttribute("connectionDurationAve", new Long(0)); /* Wouldl this be valueable to calculate? We used to show this in the old jetty only portlet */
} else {
renderRequest.setAttribute("statsSupported", Boolean.TRUE);
renderRequest.setAttribute("statsMessage", "Statistics are not currently being collected.");
}