Skip site navigation (1) Skip section navigation (2)

Re: about monitoring the input stream

From: Marc Herbert <Marc(dot)Herbert(at)continuent(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: about monitoring the input stream
Date: 2006-09-12 14:31:40
Message-ID: khju03d6trn.fsf@meije.emic.fr (view raw or flat)
Thread:
Lists: pgsql-jdbc
Albert Cardona <acardona(at)ini(dot)phys(dot)ethz(dot)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.



In response to

pgsql-jdbc by date

Next:From: Albert CardonaDate: 2006-09-13 16:09:54
Subject: Re: about monitoring the input stream
Previous:From: Kris JurkaDate: 2006-09-11 17:42:54
Subject: Re: Set of cursors from database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group