Author: jfrederic.clere(a)jboss.com
Date: 2009-01-15 12:37:23 -0500 (Thu, 15 Jan 2009)
New Revision: 2172
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Add a count of "active" sessions for each node.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-01-15 17:21:49 UTC (rev 2171)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-01-15 17:37:23 UTC (rev 2172)
@@ -1363,6 +1363,25 @@
ap_rprintf(r, "</pre>");
}
+static int count_sessionid(request_rec *r, char *route)
+{
+ int size, i;
+ int *id;
+ int count = 0;
+
+ /* Count the sessionid corresponding to the route */
+ size = get_max_size_sessionid(sessionidstatsmem);
+ id = apr_palloc(r->pool, sizeof(int) * size);
+ size = get_ids_used_sessionid(sessionidstatsmem, id);
+ for (i=0; i<size; i++) {
+ sessionidinfo_t *ou;
+ if (get_sessionid(sessionidstatsmem, &ou, id[i]) != APR_SUCCESS)
+ continue;
+ if (strcmp(route, ou->JVMRoute) == 0)
+ count++;
+ }
+ return count;
+}
static int manager_info(request_rec *r)
{
int size, i;
@@ -1447,9 +1466,9 @@
flushpackets, ou->mess.flushwait,
ou->mess.ping, ou->mess.smax, ou->mess.ttl);
proxystat = (proxy_worker_stat *) ou->stat;
- ap_rprintf(r, ",Elected: %d,Read: %d,Transfered: %d,Connected: %d,Load:
%d\n",
+ ap_rprintf(r, ",Elected: %d,Read: %d,Transfered: %d,Connected: %d,Load: %d
Num sessions: %d\n",
proxystat->elected, proxystat->read, proxystat->transferred,
- proxystat->busy, proxystat->lbfactor);
+ proxystat->busy, proxystat->lbfactor, count_sessionid(r,
ou->mess.JVMRoute));
/* Process the Vhosts */
manager_info_hosts(r, id[i]);
Show replies by date