Skip to content

Commit

Permalink
Fixed node concurrency stats and added total number of connections
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jul 11, 2008
1 parent 5b838a6 commit f318292
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Expand Up @@ -114,28 +114,28 @@ public String getNodeConcurrencyStatisticsAsText() {
StringBuilder out = new StringBuilder();
for (String pool : stats.keySet()) {
out
.append("---------------------------------------------------------------------------------------------------------");
out.append(lineFeed);
.append("-------------------------------------------------------------------------------------------------------------------------------"); out.append(lineFeed);
out.append(" CONNECTION TYPE: ");
out.append(pool);
out.append(lineFeed);
out
.append("---------------------------------------------------------------------------------------------------------");
.append("-------------------------------------------------------------------------------------------------------------------------------");
out.append(lineFeed);
out
.append(" NODE ID LAST CONNECT TIME NUMBER OF REJECTIONS AVG CONNECTED TIME");
out
.append("---------------------------------------------------------------------------------------------------------");
.append(" NODE ID LAST CONNECT TIME NUMBER OF CONNECTIONS NUMBER OF REJECTIONS AVG CONNECTED TIME");
out.append(lineFeed);
out
.append("-------------------------------------------------------------------------------------------------------------------------------"); out.append(lineFeed);
Map<String, NodeConnectionStatistics> nodeStats = stats.get(pool);
for (String nodeId : nodeStats.keySet()) {
NodeConnectionStatistics nodeStat = nodeStats.get(nodeId);
StringUtils.leftPad(nodeId, 20);
StringUtils.leftPad(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(
new Date(nodeStat.getLastConnectionTimeMs())), 30);
StringUtils.leftPad(Integer.toString(nodeStat.getNumOfRejections()), 30);
StringUtils.leftPad(NumberFormat.getIntegerInstance().format(
nodeStat.getTotalConnectionTimeMs() / nodeStat.getTotalConnectionCount()), 20);
out.append(StringUtils.leftPad(nodeId, 20));
out.append(StringUtils.leftPad(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(
new Date(nodeStat.getLastConnectionTimeMs())), 30));
out.append(StringUtils.leftPad(Long.toString(nodeStat.getTotalConnectionCount()), 27));
out.append(StringUtils.leftPad(Integer.toString(nodeStat.getNumOfRejections()), 25));
out.append(StringUtils.leftPad(NumberFormat.getIntegerInstance().format(
nodeStat.getTotalConnectionTimeMs() / nodeStat.getTotalConnectionCount()), 25));
}
out.append(lineFeed);
}
Expand Down
Expand Up @@ -56,7 +56,7 @@ public void doFilter(final ServletRequest req, final ServletResponse resp, final
throws IOException, ServletException {

HttpServletRequest httpRequest = (HttpServletRequest) req;
String poolId = httpRequest.getServletPath();
String poolId = httpRequest.getRequestURI();
String nodeId = StringUtils.trimToNull(req.getParameter(WebConstants.NODE_ID));
String method = httpRequest.getMethod();

Expand Down

0 comments on commit f318292

Please sign in to comment.