From: Marc Herbert <Marc.Herbert@continuent.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: about monitoring the input stream
Date: Tue, 12 Sep 2006 16:31:40 +0200
Message-ID: <khju03d6trn.fsf@meije.emic.fr> (raw)
References: <200609111859.51271.acardona@ini.phys.ethz.ch>
Albert Cardona <acardona@ini.phys.ethz.ch> writes:
> Following up from
> http://archives.postgresql.org/pgsql-jdbc/2006-07/msg00052.php
> I wonder if anything has been done on the subject of monitoring the amount of
> bytes since the last query?
>
> Finally I've digged into the code and put my hands through reflection on the
> InputStream encapsulated in the PGStream. Problem is, the stream is emptied
> frequently and I can't find the class responsible for reading it out, so my
> readings of the available() bytes (in a monitoring thread) underestimate
> tremendously the amount of bytes actually piped.
Why don't you decorate the InputStream with some simple
CountingInputStream of yours, just like Oliver suggested?
Something very similar to:
private java.io.DataOutputStream#incCount()
If you are lazy you could even extend BufferInputStream; like this
you have just two read methods to override.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: Marc.Herbert@continuent.com
Subject: Re: about monitoring the input stream
In-Reply-To: <khju03d6trn.fsf@meije.emic.fr>
References: <200609111859.51271.acardona@ini.phys.ethz.ch> <khju03d6trn.fsf@meije.emic.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox