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-19 09:47:59
Message-ID: 4B2CA14F.6030305@rsu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.2 text/plain 8.6 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maciek Sakrejda 2009-12-21 01:24:39 Re: Cheapest way to poll for notifications? & Driver improvement question re SSL and notify
Previous Message Craig Ringer 2009-12-19 07:24:53 Re: Cheapest way to poll for notifications?