Re: Get bytes sent to client

From: Alexander Pyhalov <alp(at)rsu(dot)ru>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: dmp <danap(at)ttc-cmc(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Get bytes sent to client
Date: 2009-12-21 09:19:52
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Extending VisibleBufferedInputStream was not a good idea - work with
buffer (like ensureBytes() calls ) can't be accounted. So, I modified
it. Results are more precise now.

Alexander Pyhalov wrote:
> Good day..
> I've just made new patch - extended BufferedOutputStream and
> VisibleBufferedInputStream, as you suggested. It works, and results are
> comparable with tcpdump data (for received traffic). For sent traffic
> they are incorrect, because I can't account all ACK, but only PGSQL
> traffic.
> It's suprising, that received traffic is more then tcpdump shows ( 2%,
> butt more). I thought it would be a bit smaller then actual data.
> However, this data gives good approximation (2% for 100MB traffic is not
> a lot).
> Craig Ringer wrote:
>> On 18/12/2009 2:34 PM, Alexander Pyhalov wrote:
>>> I've made patch for Postgres JDBC driver. Now driver accounts bytes
>>> sent/received from client ing PGStream.
>> Can't you extend or wrap the pg_input / pg_output streams to do the
>> accounting in their read(...) / write(...) method instead? The way
>> you've done it is rather fragile and is very prone to bitrot as other
>> parts of the driver are changed.
>> --
>> Craig Ringer
> ------------------------------------------------------------------------

С уважением,
Александр Пыхалов,
системный администратор ЮГИНФО ЮФУ.

Attachment Content-Type Size
patch.pgsql.3 text/plain 8.3 KB

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message rsmogura 2009-12-21 09:41:01 Re: Cheapest way to poll for notifications? & Driver improvement question re SSL and notify
Previous Message Oliver Jowett 2009-12-21 08:08:13 Re: Issue with the JDBC driver doing timezone conversions on "java.sql.Date"?