Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32A1C6633 for ; Tue, 24 May 2011 16:21:01 +0000 (UTC) Received: (qmail 27229 invoked by uid 500); 24 May 2011 16:21:00 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 27202 invoked by uid 500); 24 May 2011 16:21:00 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 27193 invoked by uid 99); 24 May 2011 16:21:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 16:20:59 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 16:20:53 +0000 Received: from [192.168.245.129] (p549E0B27.dip0.t-ipconnect.de [84.158.11.39]) by tor.combios.es (Postfix) with ESMTPA id 32D282260B5 for ; Tue, 24 May 2011 18:20:31 +0200 (CEST) Message-ID: <4DDBDAC7.3020709@ice-sa.com> Date: Tue, 24 May 2011 18:20:23 +0200 From: =?ISO-8859-15?Q?Andr=E9_Warnier?= Reply-To: mod_perl list User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: mod_perl list Subject: Re: Measuring response time Apache request References: <4DDBCF19.30605@gmail.com> <4DDBD04A.6010309@utoronto.ca> <4DDBD1DB.60705@gmail.com> In-Reply-To: <4DDBD1DB.60705@gmail.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org marco wrote: > Il 24/05/2011 17.35, Adam Prime ha scritto: >> On 11-05-24 11:30 AM, marco wrote: >>> Hi all, >>> I want to get the response time that Apache spends to serve a request >>> (from post-read-request phase to the response phase). >>> Any idea? >>> >>> Thanks >> >> I'm pretty sure there are messages buried in the archives (from >> torsten) showing how to do this with $r->push_handlers and Time::HiRes >> (or something along those lines). It's not really that complicated >> though, you basically just have a PostReadRequestHandler that uses >> push_handlers to push a handler into every phase that just logs the >> current time, or whatever it is you want to log. >> >> Adam >> >> > Hi Adam, > I'm in this list only since 2 weeks. Can you tell me where can I find > this mails? > Thanks a lot. > To answer you last question : Go to : http://perl.apache.org/ On the left side, there is an item : Mailing lists This leads you to the : mod_perl Users mailing list This leads you to the : Searchable archives where you have a choice of searchable archives. and have a look for example at "marc.theaimsgroup.com" Apart from that, and for the main issue : Is it not easier to just read the Apache access log a posteriori, and filter the lines which you need ? With the appropriate LogFormat, you can have the microseconds needed for each request. See : http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats (parameter %D) e.g. LogFormat "%a - %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined_ip CustomLog /var/log/apache2/somehost/access.log combined_ip Sample log line with the above format (server name changed for privacy) : 192.168.193.11 - U367532 [24/May/2011:17:49:05 +0200] "POST /starweb/OPAC/servlet.starweb HTTP/1.0" 200 28029 "http://somehost.mycompany.com/starweb/OPAC/servlet.starweb?path=OPAC/STARLibs_OPAC_xxx.web" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)" 147626 (the last number is the number of microseconds needed to process that request)