Re: how to monitor the amount of bytes fetched in a executeQuery() - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: how to monitor the amount of bytes fetched in a executeQuery()
Date
Msg-id 44B57436.9040308@opencloud.com
Whole thread Raw
In response to Re: how to monitor the amount of bytes fetched in a executeQuery()  ("Nicholas E. Wakefield" <nwakefield@KineticNetworks.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: executeQuery Locked
Next
From: Albert Cardona
Date:
Subject: Re: how to monitor the amount of bytes fetched in a executeQuery()