www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Greis <pe...@netgen.com>
Subject mod_log-any/2838: Enhancement to mod_log_config
Date Wed, 12 Aug 1998 15:17:38 GMT

>Number:         2838
>Category:       mod_log-any
>Synopsis:       Enhancement to mod_log_config
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Wed Aug 12 08:20:00 PDT 1998
>Originator:     peter@netgen.com
>Release:        1.3.1
SunOS new-york 5.6 Generic sun4u sparc SUNW,Ultra-1
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/
gcc version
While the logging module allows for tracking the duration of a request, the time
granularity is too coarse for tracking software (such as ours). I have added
another configurable option which allows for millisecond granularity of
transaction durations. Optimally I would like to see this folded into the
released version of Apache.



add to httpd.conf:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
\"-\" \"-\" %m" netgenesis
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
\"-\" \"%{cookie}n\" %m" netgenesis_cookie

then somewhere below:

CustomLog /<...path to log file goes here...>/access_log netgenesis

The following generated with diff against 1.3.1 sources...


>  * %...m:  the time taken to serve the request, in milli-seconds.
> /* Gather request timing down to the millisecond level, as just plain ol' seconds
> ** are useless for performance statistics
> */
> static const char *log_request_duration_fine(request_rec *r, char *a)
> {
>   long sec, msec, duration;
>   struct timeval t;
>   gettimeofday(&t, NULL);
>   sec = t.tv_sec - r->request_time_fine.tv_sec; /* Seconds portion, usually zero */
>   msec = t.tv_usec - r->request_time_fine.tv_usec;
>   duration = sec * 1000.0 + msec / 1000.0;
>   return ap_psprintf(r->pool, "%ld", duration);
> }
>         'm', log_request_duration_fine, 1
>     },
>     {


>       /* net.Genesis addition */
>       gettimeofday(&(r->request_time_fine), NULL);
>     /* net.Genesis addition */
>     gettimeofday(&(r->request_time_fine), NULL);

[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]

View raw message