diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-18 20:50:44 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-18 20:50:44 +0100 |
commit | 3aa76ee5d430e922b190a89de0844459d0843a9d (patch) | |
tree | 099cb5fe269261c5a2fe159e17ae869d76dad60e | |
parent | e7c5bd0fecd796587373a7805ab21fd96f0359e2 (diff) |
Add total time (as seen by LXRng) to profiling data.
-rw-r--r-- | lib/LXRng/ModPerl.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/LXRng/ModPerl.pm b/lib/LXRng/ModPerl.pm index 60bb1c7..1e1cd95 100644 --- a/lib/LXRng/ModPerl.pm +++ b/lib/LXRng/ModPerl.pm @@ -23,6 +23,7 @@ use strict; use LXRng; use LXRng::Web; +use Time::HiRes qw(time); use Apache2::Const -compile => qw(FORBIDDEN OK); use CGI; @@ -31,14 +32,14 @@ use Data::Dumper; sub handler { my ($req) = @_; - my @tstart = times(); + my @tstart = (time+0, times()); my $query = CGI->new(); my $qident = LXRng::Web->handle($query); - my @tstop = times(); + my @tstop = (time+0, times()); $req->notes->add("lxr_prof" => - sprintf("U/S/CU/CS: %d/%d/%d/%d ms", - map { 1000*($tstop[$_]-$tstart[$_]) } (0 .. 3))); + sprintf("T/U/S/CU/CS: %d/%d/%d/%d/%d ms", + map { 1000*($tstop[$_]-$tstart[$_]) } (0 .. 4))); $req->notes->add("lxr_ident" => $qident); return Apache2::Const::OK; |