diff --git a/CHANGES b/CHANGES index 4946e859e7..56a3bcc592 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) mod_status: Add cumulated response duration time in milliseconds. + [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] diff --git a/include/ap_mmn.h b/include/ap_mmn.h index aea09879c5..e42f8ff891 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -589,6 +589,8 @@ * 20180720.2 (2.5.1-dev) Add optional function declaration for * ap_proxy_balancer_get_best_worker to mod_proxy.h. * 20180720.3 (2.5.1-dev) Add client64 to worker_share + * 20180720.4 (2.5.1-dev) Add new duration field to worker_score struct in + * scoreboard.h * */ @@ -597,7 +599,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20180720 #endif -#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 4 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/scoreboard.h b/include/scoreboard.h index 42b04d1ee7..1a4bd7cb3e 100644 --- a/include/scoreboard.h +++ b/include/scoreboard.h @@ -117,6 +117,7 @@ struct worker_score { char vhost[32]; /* What virtual host is being accessed? */ char protocol[16]; /* What protocol is used on the connection? */ char client64[64]; + apr_time_t duration; }; typedef struct { diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 490e9e8615..90cc7b0131 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -193,6 +193,8 @@ 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; + apr_time_t duration_slot; int short_report; int no_table_report; worker_score *ws_record; @@ -232,6 +234,7 @@ static int status_handler(request_rec *r) count = 0; bcount = 0; kbcount = 0; + duration_global = 0; short_report = 0; no_table_report = 0; @@ -374,6 +377,7 @@ static int status_handler(request_rec *r) count += lres; bcount += bytes; + duration_global += ws_record->duration; if (bcount >= KBYTE) { kbcount += (bcount >> 10); @@ -461,8 +465,9 @@ static int status_handler(request_rec *r) if (ap_extended_status) { 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 */ @@ -482,14 +487,17 @@ 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, "