X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CCA969FB3D4 for ; Wed, 12 Jul 2006 19:14:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 84771-08 for ; Wed, 12 Jul 2006 19:14:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id BC2B29FB3C0 for ; Wed, 12 Jul 2006 19:14:17 -0300 (ADT) Received: from 203-118-178-246.bliink.ihug.co.nz ([203.118.178.246] helo=[10.1.1.6]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1G0myF-0000OL-Jm; Thu, 13 Jul 2006 10:14:15 +1200 Message-ID: <44B57436.9040308@opencloud.com> Date: Thu, 13 Jul 2006 10:14:14 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Albert Cardona CC: pgsql-jdbc@postgresql.org Subject: Re: how to monitor the amount of bytes fetched in a executeQuery() References: <2F2A7EB72EBAF24582513E72ACCBCAAE11A2D6@kniexch01.KineticNetworks.com> <200607120856.12722.acardona@ini.phys.ethz.ch> <44B56D9A.5030302@opencloud.com> <200607121500.01107.acardona@ini.phys.ethz.ch> In-Reply-To: <200607121500.01107.acardona@ini.phys.ethz.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/53 X-Sequence-Number: 15479 Albert Cardona wrote: > I will have a look at the code myself but I'm not familiar with it -you say > it's at PGconnection class? org.postgresql.PGConnection is our extension interface that applications use to get access to driver-specific features. The actual implementation would go in AbstractJdbc2Connection which would delegate to the protocol-level code in org/postgresql/core/* to get stats from the underlying connection. Looks like you may need to play with PGStream so it actually tracks the byte count, unless one of the wrapping streams already does that. app code would look something like this: Connection c = /* get connection */; if (c instanceof PGConnection) { PGConnection pgc = (PGConnection)c; long byteCount = pgc.getInputByteCount(); // or whatever } -O