Author: rjung
Date: Sun Dec 21 15:05:55 2014
New Revision: 1647150

URL: http://svn.apache.org/r1647150
Log:
PR 56869: Status: Add maximum number of open backend connections
to status worker. Patch contributed by Martin Knoblauch.

Modified:
    tomcat/jk/trunk/native/common/jk_ajp_common.c
    tomcat/jk/trunk/native/common/jk_shm.h
    tomcat/jk/trunk/native/common/jk_status.c
    tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1647150&r1=1647149&r2=1647150&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp_common.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp_common.c Sun Dec 21 15:05:55 2014
@@ -1041,6 +1041,10 @@ int ajp_connect_to_endpoint(ajp_endpoint
         return JK_FALSE;
     }
     ae->worker->s->connected++;
+    /* Update maximum number of connections
+    */
+    if (ae->worker->s->connected > ae->worker->s->max_connected)
+        ae->worker->s->max_connected = ae->worker->s->connected;  
     /* set last_access only if needed
      */
     if (ae->worker->cache_timeout > 0)

Modified: tomcat/jk/trunk/native/common/jk_shm.h
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_shm.h?rev=1647150&r1=1647149&r2=1647150&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_shm.h (original)
+++ tomcat/jk/trunk/native/common/jk_shm.h Sun Dec 21 15:05:55 2014
@@ -98,6 +98,8 @@ struct jk_shm_ajp_worker
     /* Statistical data */
     /* Number of currently connected channels */
     volatile int connected;
+    /* Maximum number of connected channels */
+    volatile int max_connected;
     /* Number of currently busy channels */
     volatile int busy;
     /* Maximum number of busy channels */

Modified: tomcat/jk/trunk/native/common/jk_status.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_status.c?rev=1647150&r1=1647149&r2=1647150&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_status.c (original)
+++ tomcat/jk/trunk/native/common/jk_status.c Sun Dec 21 15:05:55 2014
@@ -263,7 +263,7 @@
                                            "<th>State</th>" \
                                            "<th>Acc</th>" \
                                            
"<th>Err</th><th>CE</th><th>RE</th>" \
-                                           
"<th>Wr</th><th>Rd</th><th>Busy</th><th>Max</th><th>Con</th><th>LR</th><th>LE</th>"
 \
+                                           
"<th>Wr</th><th>Rd</th><th>Busy</th><th>MaxBusy</th><th>Con</th><th>MaxCon</th><th>LR</th><th>LE</th>"
 \
                                            "</tr>\n"
 #define JK_STATUS_SHOW_AJP_ROW             "<tr>" \
                                            "<td>%s</td>" \
@@ -277,6 +277,7 @@
                                            "<td>%d</td>" \
                                            "<td>%d</td>" \
                                            "<td>%d</td>" \
+                                           "<td>%d</td>" \
                                            "<td>%s</td>" \
                                            "</tr>\n"
 #define JK_STATUS_SHOW_LB_HEAD             "<tr>" \
@@ -308,7 +309,7 @@
                                            "<th>D</th><th>F</th><th>M</th>" \
                                            
"<th>V</th><th>Acc</th><th>Sess</th>" \
                                            
"<th>Err</th><th>CE</th><th>RE</th>" \
-                                           
"<th>Wr</th><th>Rd</th><th>Busy</th><th>Max</th><th>Con</th>" \
+                                           
"<th>Wr</th><th>Rd</th><th>Busy</th><th>MaxBusy</th><th>Con</th><th>MaxCon</th>"
 \
                                            "<th>" JK_STATUS_ARG_LBM_TEXT_ROUTE 
"</th>" \
                                            
"<th>RR</th><th>Cd</th><th>Rs</th><th>LR</th><th>LE</th>" \
                                            "</tr>\n"
@@ -329,6 +330,7 @@
                                            "<td>%d</td>" \
                                            "<td>%d</td>" \
                                            "<td>%d</td>" \
+                                           "<td>%d</td>" \
                                            "<td>%s</td>" \
                                            "<td>%s</td>" \
                                            "<td>%s</td>" \
@@ -1849,6 +1851,7 @@ static void display_worker_ajp_details(j
                       aw->s->busy,
                       aw->s->max_busy,
                       aw->s->connected,
+                      aw->s->max_connected,
                       wr->route,
                       wr->redirect ? (*wr->redirect ? wr->redirect : "&nbsp;") 
: "&nbsp",
                       wr->domain ? (*wr->domain ? wr->domain : "&nbsp;") : 
"&nbsp",
@@ -1871,6 +1874,7 @@ static void display_worker_ajp_details(j
                       aw->s->busy,
                       aw->s->max_busy,
                       aw->s->connected,
+                      aw->s->max_connected,
                       delta_reset,
                       rc_time > 0 ? buf_time : "&nbsp;");
         }
@@ -1928,6 +1932,7 @@ static void display_worker_ajp_details(j
         jk_print_xml_att_int(s, off+2, "busy", aw->s->busy);
         jk_print_xml_att_int(s, off+2, "max_busy", aw->s->max_busy);
         jk_print_xml_att_int(s, off+2, "connected", aw->s->connected);
+        jk_print_xml_att_int(s, off+2, "max_connected", aw->s->max_connected);
         if (lb) {
             jk_print_xml_att_int(s, off+2, "time_to_recover_min", rs_min);
             jk_print_xml_att_int(s, off+2, "time_to_recover_max", rs_max);
@@ -1995,6 +2000,7 @@ static void display_worker_ajp_details(j
         jk_printf(s, " busy=%d", aw->s->busy);
         jk_printf(s, " max_busy=%d", aw->s->max_busy);
         jk_printf(s, " connected=%d", aw->s->connected);
+        jk_printf(s, " max_connected=%d", aw->s->max_connected);
         if (lb) {
             jk_printf(s, " time_to_recover_min=%d", rs_min);
             jk_printf(s, " time_to_recover_max=%d", rs_max);
@@ -2059,6 +2065,7 @@ static void display_worker_ajp_details(j
         jk_print_prop_att_int(s, w, ajp_name, "busy", aw->s->busy);
         jk_print_prop_att_int(s, w, ajp_name, "max_busy", aw->s->max_busy);
         jk_print_prop_att_int(s, w, ajp_name, "connected", aw->s->connected);
+        jk_print_prop_att_int(s, w, ajp_name, "max_connected", 
aw->s->max_connected);
         if (lb) {
             jk_print_prop_att_int(s, w, ajp_name, "time_to_recover_min", 
rs_min);
             jk_print_prop_att_int(s, w, ajp_name, "time_to_recover_max", 
rs_max);
@@ -3724,8 +3731,9 @@ static void display_legend(jk_ws_service
             "<tr><th>Wr</th><td>Number of bytes transferred</td></tr>\n"
             "<tr><th>Rd</th><td>Number of bytes read</td></tr>\n"
             "<tr><th>Busy</th><td>Current number of busy 
connections</td></tr>\n"
-            "<tr><th>Max</th><td>Maximum number of busy 
connections</td></tr>\n"
+            "<tr><th>MaxBusy</th><td>Maximum number of busy 
connections</td></tr>\n"
             "<tr><th>Con</th><td>Current number of backend 
connections</td></tr>\n"
+            "<tr><th>MaxCon</th><td>Maximum number of backend 
connections</td></tr>\n"
             "<tr><th>RR</th><td>Route redirect</td></tr>\n"
             "<tr><th>Cd</th><td>Cluster domain</td></tr>\n"
             "<tr><th>Rs</th><td>Recovery scheduled in app. min/max 
seconds</td></tr>\n"

Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1647150&r1=1647149&r2=1647150&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Sun Dec 21 15:05:55 2014
@@ -89,6 +89,10 @@
       <add>
         Add more checks for shared memory allocation. (rjung)
       </add>
+      <add>
+        <bug>56869</bug>: Status: Add maximum number of open backend 
connections
+        to status worker. Patch contributed by Martin Knoblauch. (rjung)
+      </add>
     </changelog>
   </subsection>
 </section>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to