From: Yann Ylavic Date: Mon, 11 May 2015 09:40:52 +0000 (+0000) Subject: [REVERTED by r1679205] X-Git-Tag: 2.2.30~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84bd8b02c25269bf8f614f1a139e2a458d7c483c;p=thirdparty%2Fapache%2Fhttpd.git [REVERTED by r1679205] Merge r1675533 from trunk. mod_log_config: Add %M format to output request duration in milliseconds. Committed by: breser Reviewed by: breser, druggeri, ylavic Backported by: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1678706 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index bfacf3e7a71..5b26f3ffee3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.30 + *) mod_log_config: Add %M format to output request duration in + milliseconds. [Ben Reser] + *) mod_ssl: New directive SSLSessionTickets (On|Off). The directive controls the use of TLS session tickets (RFC 5077), default value is "On" (unchanged behavior). diff --git a/STATUS b/STATUS index 03910f2936c..3330aacec20 100644 --- a/STATUS +++ b/STATUS @@ -101,11 +101,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_log_config: Add new format flag for requestion duration in milliseconds - trunk patch: http://svn.apache.org/r1675533 - 2.2.x patch: https://people.apache.org/~breser/httpd/2.2.x/patches/httpd-2.2.x-req_duration_milliseconds.patch (modulo CHANGES) - +1: breser, druggeri, ylavic - * mod_unique_id: Update docs and comment: the unique id is now 24 characters, not 19 See explanation in: http://httpd.apache.org/docs/2.2/mod/mod_unique_id.html#comment_3564 diff --git a/docs/manual/mod/mod_log_config.xml b/docs/manual/mod/mod_log_config.xml index 6b71a8fe3a5..ec8af7d9ed8 100644 --- a/docs/manual/mod/mod_log_config.xml +++ b/docs/manual/mod/mod_log_config.xml @@ -131,6 +131,9 @@ %m The request method + %M + The time taken to serve the request, in milliseconds. + %{Foobar}n The contents of note Foobar from another module. diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 058a306deda..930d35b8138 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -104,6 +104,7 @@ * %...{format}t: The time, in the form given by format, which should * be in strftime(3) format. * %...T: the time taken to serve the request, in seconds. + * %...M: the time taken to serve the request, in milliseconds * %...D: the time taken to serve the request, in micro seconds. * %...u: remote user (from auth; may be bogus if return status (%s) is 401) * %...U: the URL path requested. @@ -668,6 +669,13 @@ static const char *log_request_duration(request_rec *r, char *a) return apr_psprintf(r->pool, "%" APR_TIME_T_FMT, apr_time_sec(duration)); } +static const char *log_request_duration_milliseconds(request_rec *r, char *a) +{ + apr_time_t duration = get_request_end_time(r) - r->request_time; + return apr_psprintf(r->pool, "%" APR_TIME_T_FMT, apr_time_as_msec(duration)); +} + + static const char *log_request_duration_microseconds(request_rec *r, char *a) { return apr_psprintf(r->pool, "%" APR_TIME_T_FMT, @@ -1574,6 +1582,7 @@ static int log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) log_pfn_register(p, "k", log_requests_on_connection, 0); log_pfn_register(p, "r", log_request_line, 1); log_pfn_register(p, "D", log_request_duration_microseconds, 1); + log_pfn_register(p, "M", log_request_duration_milliseconds, 1); log_pfn_register(p, "T", log_request_duration, 1); log_pfn_register(p, "U", log_request_uri, 1); log_pfn_register(p, "s", log_status, 1);