httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1393338 - in /httpd/httpd/trunk: include/httpd.h server/util.c
Date Wed, 03 Oct 2012 08:20:50 GMT
Author: jorton
Date: Wed Oct  3 08:20:50 2012
New Revision: 1393338

URL: http://svn.apache.org/viewvc?rev=1393338&view=rev
Log:
Extract some more data through the server load API:

* include/httpd.h (struct ap_sload_t): Add bytes_served, access_count
  fields.

* server/util.c (ap_get_sload): Fill in those fields.

Submitted by: Jan Kaluza <jkaluza redhat.com>

Modified:
    httpd/httpd/trunk/include/httpd.h
    httpd/httpd/trunk/server/util.c

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1393338&r1=1393337&r2=1393338&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Wed Oct  3 08:20:50 2012
@@ -1308,6 +1308,10 @@ struct ap_sload_t {
     int idle;
     /* percentage of process/threads busy (0->100) */
     int busy;
+    /* total bytes served */
+    apr_off_t bytes_served;
+    /* total access count */
+    unsigned long access_count;
 };
 
 /**

Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1393338&r1=1393337&r2=1393338&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Wed Oct  3 08:20:50 2012
@@ -2802,6 +2802,8 @@ AP_DECLARE(void) ap_get_sload(ap_sload_t
     /* preload errored fields, we overwrite */
     ld->idle = -1;
     ld->busy = -1;
+    ld->bytes_served = 0;
+    ld->access_count = 0;
 
     ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation);
     ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
@@ -2827,6 +2829,14 @@ AP_DECLARE(void) ap_get_sload(ap_sload_t
                     busy++;
                 }   
             }
+
+            if (ap_extended_status && !ps->quiescing && ps->pid) {
+                if (ws->access_count != 0 
+                    || (res != SERVER_READY && res != SERVER_DEAD)) {
+                    ld->access_count += ws->access_count;
+                    ld->bytes_served += ws->bytes_served;
+                }
+            }
         }
     }
     total = busy + ready;



Mime
View raw message