Commit 27c1cc66 authored by Rainer Jung's avatar Rainer Jung
Browse files

mod_status: Add cumulated response duration time

in milliseconds to auto mode.

Partial backport of r1839532 from trunk
(only auto mode changes, html parts not yet
backported).

Submitted by: rjung
Reviewed by: rjung, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1839533 13f79535-47bb-0310-9956-ffa450edef68
parent 841658c9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -10,6 +10,10 @@ Changes with Apache 2.4.35
     "ProxyStatus" is "On": add "busy" count to auto mode and show byte
     counts in auto mode always in units of kilobytes.  [Rainer Jung]

  *) mod_status: Add cumulated response duration time in milliseconds
     to auto mode.
     [Rainer Jung]

  *) mod_status: Complete the data shown for async MPMs in "auto" mode.
     Added number of processes, number of stopping processes and number
     of busy and idle workers.  [Rainer Jung]
+0 −7
Original line number Diff line number Diff line
@@ -147,13 +147,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: http://people.apache.org/~covener/2.4.x-proxy-opt-fn.diff
      +1: covener, jim, ylavic

   *) mod_status: Add cumulated response duration time
      in milliseconds.
      trunk: http://svn.apache.org/r1837590
      2.4.x patch: svn merge -c 1837590 ^/httpd/httpd/trunk . 
                   (adjust CHANGES and include/ap_mmn.h)
      +1: rjung, jim, ylavic


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+3 −1
Original line number Diff line number Diff line
@@ -518,6 +518,8 @@
 * 20120211.80 (2.4.35-dev) Add new ap_update_global_status() method and
 *                          times field in the global_score structure in
 *                          scoreboard.h.
 * 20120211.81 (2.4.35-dev) Add new duration field to worker_score struct in
 *                          scoreboard.h
 *
 */

@@ -526,7 +528,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20120211
#endif
#define MODULE_MAGIC_NUMBER_MINOR 80                  /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 81                  /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+1 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ struct worker_score {
    char request[64];           /* We just want an idea... */
    char vhost[32];             /* What virtual host is being accessed? */
    char protocol[16];          /* What protocol is used on the connection? */
    apr_time_t duration;
};

typedef struct {
+12 −4
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ static int status_handler(request_rec *r)
    apr_off_t bytes, my_bytes, conn_bytes;
    apr_off_t bcount, kbcount;
    long req_time;
    apr_time_t duration_global;
    int short_report;
    int no_table_report;
    global_score *global_record;
@@ -234,6 +235,7 @@ static int status_handler(request_rec *r)
    count = 0;
    bcount = 0;
    kbcount = 0;
    duration_global = 0;
    short_report = 0;
    no_table_report = 0;

@@ -385,6 +387,7 @@ static int status_handler(request_rec *r)

                    count += lres;
                    bcount += bytes;
                    duration_global += ws_record->duration;

                    if (bcount >= KBYTE) {
                        kbcount += (bcount >> 10);
@@ -473,8 +476,9 @@ static int status_handler(request_rec *r)
        clock_t cpu = gu + gs + gcu + gcs + tu + ts + tcu + tcs;
        if (short_report) {
            ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %"
                       APR_OFF_T_FMT "\n",
                       count, kbcount);
                       APR_OFF_T_FMT "\nTotal Duration: %"
                       APR_TIME_T_FMT "\n",
                       count, kbcount, duration_global / 1000);

#ifdef HAVE_TIMES
            /* Allow for OS/2 not having CPU stats */
@@ -494,9 +498,12 @@ static int status_handler(request_rec *r)
                ap_rprintf(r, "BytesPerSec: %g\n",
                           KBYTE * (float) kbcount / (float) up_time);
            }
            if (count > 0)
            if (count > 0) {
                ap_rprintf(r, "BytesPerReq: %g\n",
                           KBYTE * (float) kbcount / (float) count);
                ap_rprintf(r, "DurationPerReq: %g\n",
                           (float) duration_global / (float) count / 1000.);
            }
        }
        else { /* !short_report */
            ap_rprintf(r, "<dt>Total accesses: %lu - Total Traffic: ", count);
@@ -530,7 +537,8 @@ static int status_handler(request_rec *r)
                    ap_rputs(" - ", r);
                format_byte_out(r, (unsigned long)(KBYTE * (float) kbcount
                                                   / (float) count));
                ap_rputs("/request", r);
                ap_rprintf(r, "/request - %g ms/request",
                (float) duration_global / (float) count / 1000.);
            }

            ap_rputs("</dt>\n", r);
Loading