Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

acme (189)

acme
  (email not shown publicly)
http://www.astray.com/

Leon Brocard (aka acme) is an orange-loving Perl eurohacker with many varied contributions to the Perl community, including the GraphViz module on the CPAN. YAPC::Europe was all his fault. He is still looking for a Perl Monger group he can start which begins with the letter 'D'.

Journal of acme (189)

Monday April 05, 2004
03:05 AM

mod_stopwatch

[ #18204 ]
All I seem to do these days is to write monitoring tools. sky prodded me to investigate getting Apache to give decent information on how long requests take to process. It has a T option which can report in seconds, but that's way too low resolution. May I present mod_stopwatch, which gives microsecond resolution:

192.168.5.254 - - [02/Apr/2004:17:22:48 +0100] "GET / HTTP/1.1" 200 1456 (1525 usecs)
192.168.5.254 - - [02/Apr/2004:17:22:48 +0100] "GET /apache_pb.gif HTTP/1.1" 200 2326 (89 usecs)

Note that the index page takes longer than the GIF as it must go through mod_dir etc. Now if only there was an CAAN to upload this to...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Here's how I get CPU times:

    package Stonehenge::Timeit;
    use strict;

    ## usage: PerlInitHandler Stonehenge::Timeit;

    use vars qw($VERSION);
    $VERSION = (qw$Revision: 1.1.1.1 $ )[-1];

    use Apache::Constants qw(OK DECLINED);
    use Apache::File;
    use Apache::Log;

    sub handler {
      ## use Stonehenge::Reload; goto &handler if Stonehenge::Reload->reload_me;

      my $r = shift;
      return DECLINED unless $r->is_initial_req;
      my $log = $r->log;        # closure
      my $uri = $r-

    --
    • Randal L. Schwartz
    • Stonehenge
  • CAAN (Score:2, Informative)

    Now if only there was an CAAN to upload this to...

    Check out http://modules.apache.org/
    • Wow, that's really hard to find from http://httpd.apache.org/. I completely missed it looking at http://httpd.apache.org/modules/. Also, 316 modules and no index is a bit annoying. But yes, all this ranting is because I had been able to find it then I would have used mod_chronometer [apache.org]...