Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 79640 invoked from network); 26 Oct 2007 11:31:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2007 11:31:56 -0000 Received: (qmail 2718 invoked by uid 500); 26 Oct 2007 11:31:39 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 2681 invoked by uid 500); 26 Oct 2007 11:31:38 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 2670 invoked by uid 99); 26 Oct 2007 11:31:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 04:31:38 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of henri.gomez@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 11:31:40 +0000 Received: by py-out-1112.google.com with SMTP id a25so1381290pyi for ; Fri, 26 Oct 2007 04:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=FMBdSaDmXXR/Vpz5AUxkgiCfAibQSXWIizeSe3uyVsE=; b=ERC76vwvQ/UThqUhHG9MnS0l+b3f6sw0hexLXd3sJQOWMY7NDMCETzFTU79EKXKk2EaXuvE6tUahHICCFGTxmvKSy/7rI1Clep4SgQmko8lzVKq6pgpj0VP1ehXC2Kn+F2hxszLW28ZCc/lXdveM+dGvbTSL1IDAmwFjgRJJR4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aXcGBf3ppHLEBkIrSumT4ILjKbVJmfFp+dpGd8UNGxiGepMjoQuNowr50y3y9hDhiYXP4XedIEtwnYspAlQenvFQCrbcnjlDsyu9zZukLhNjmHShnUd/DKVysDMuMAYMoZ5cyD58Kxn2Sn/pec1JnoLD0c80x+LWSQzvmhY7mos= Received: by 10.65.233.16 with SMTP id k16mr6270875qbr.1193398278617; Fri, 26 Oct 2007 04:31:18 -0700 (PDT) Received: by 10.65.243.12 with HTTP; Fri, 26 Oct 2007 04:31:18 -0700 (PDT) Message-ID: <6291fc850710260431q6fcb0a96wa30c3aaaf9a3c6c1@mail.gmail.com> Date: Fri, 26 Oct 2007 13:31:18 +0200 From: "Henri Gomez" To: "Tomcat Developers List" Subject: Re: Measuring bytes sent and received from and to Tomcat In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <471AC1D9.4060102@apache.org> <1192989816.19865.4.camel@wlt.obsidian-studios.com> <1193081912.26814.4.camel@wlt.obsidian-studios.com> <96e4b5230710221527r4d5a588dy1c8ff092a2f287b8@mail.gmail.com> <96e4b5230710221549o4e38d8d1m697fed8459e526fc@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Well it should works since the Lamba Probe, got these numbers for HTTP and AJP. ie : http://www.lambdaprobe.org/d/screenshots/full/charts.png Regards 2007/10/25, Dave Rathnow : > > Hello Again, > > I was wondering if someone could give me some help with this. I think > using a connector is probably the way to go to solve this problem; > however, I'm not sure where to start. How do I create my own connector > and the plumb it into Tomcat so it will be used. I will be using a > separate port other than 8080 for the devices that will be sending and > receiveing data so, if possible, I would like to leave the default > connector on port 8080. > > Again, I don't want to reimplement the code that parses the HTTP. All I > need to do is count the number of bytes arriving and being sent so if I > can reuse code from an existing connector, that would be great. > > Thanks, > Dave. > > -----Original Message----- > From: costin@gmail.com [mailto:costin@gmail.com] On Behalf Of Costin > Manolache > Sent: October 22, 2007 04:50 PM > To: Dave Rathnow > Cc: Tomcat Developers List > Subject: Re: Measuring bytes sent and received from and to Tomcat > > Well, if you want absolute byte - connector seems the only place, there > are space and tabs beeing skipped when parsing headers, etc. > > If you are ok with an estimate - the AccessLogValve is ok, add all the > header lengths + method + http/1.1. You'll miss bytes for encodings, > spaces. > > Re. where to add - each connector is different on how it reads/parse the > message, you probably want to do it close to the 'read()' call, save it > somewhere associated with the request ( a note or attribute ) and read > it in a valve or filter. > > Costin > > > On 10/22/07, Dave Rathnow wrote: > > > > > > I looked at connectors but wasn't sure if this was what I wanted. To > > avoid anther wild goose chase I decided to ask. Can you point me in > > the direction of some documentation where I might be able to get > started? > > > > Dave. > > > > -----Original Message----- > > From: Costin Manolache [mailto:costin@gmail.com] > > Sent: October 22, 2007 04:28 PM > > To: Tomcat Developers List > > Subject: Re: Measuring bytes sent and received from and to Tomcat > > > > 'bytes' should be counted at a lower level, in connector. I'm not sure > > > this is something generic enough - but you can make some changes to > > your tomcat, where read() is done from socket. > > > > I guess it would be nice to have a JMX graph with bytes/sec in/out. > > > > Costin > > 'bytes' > > > > On 10/22/07, Dave Rathnow wrote: > > > > > > > > > We looked at using a valve but we weren't sure if it would work. > > > Correct me if I'm wrong, but it appears as though valves are chained > > > > together in a calling sequence and that some valves could change the > > > > content of the request or response. This means we may not get an > > > accurate measure of the number of total number bytes that make up > > > the request. > > > > > > Also, the AccessLogValve has a pattern code to get the number of > > > bytes > > > > > sent, excluding the HTTP headers, but does not have a pattern code > > > to get the number of bytes sent, including the HTTP headers, which > > > is what we really need. > > > > > > Have I missed something? > > > > > > Dave. > > > > > > > > > -----Original Message----- > > > From: yoavshapira@gmail.com [mailto:yoavshapira@gmail.com] On Behalf > > > > Of Yoav Shapira > > > Sent: October 22, 2007 02:36 PM > > > To: Tomcat Developers List > > > Subject: Re: Measuring bytes sent and received from and to Tomcat > > > > > > Hey, > > > > > > On 10/22/07, Dave Rathnow wrote: > > > > Is there a way we can do the same thing with Tomcat? It's simple > > > > for us to measure the number of byte in the payload of the HTTP > > > > request/response, however that isn't enough. We need to know the > > > > total number of bytes being sent and received for each HTTP > request. > > > > > > > > Can someone suggest a way I could get an accurate count of these > > > bytes? > > > > > > You can probably start with the AccessLogValve that ships with > Tomcat: > > > http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html > > > > > > Out of the box it will get you the complete bytes in the response. > > > See the above docs on how to configure that. If you want to log the > > > > complete bytes on the request, I think you'll have to extend the > > > Valve, but it should be pretty easy to do. > > > > > > Yoav > > > > > > -------------------------------------------------------------------- > > > - To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For > > > additional commands, e-mail: dev-help@tomcat.apache.org > > > > > > > > > -------------------------------------------------------------------- > > > - To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For > > > additional commands, e-mail: dev-help@tomcat.apache.org > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org > For additional commands, e-mail: dev-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org