Unix Technical Forum

about monitoring the input stream

This is a discussion on about monitoring the input stream within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Following up from http://archives.postgresql.org/pgsql...7/msg00052.php I wonder if anything has been done on the subject of monitoring the amount of ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 01:17 AM
Albert Cardona
 
Posts: n/a
Default about monitoring the input stream


Following up from
http://archives.postgresql.org/pgsql...7/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.

I understand there is only one InputStream per connection, encapsulated inside
a PGStream, created in the ProtocolConnectionImpl. Being able to monitor its
the amount of bytes fetched for each query would be really nice!

Any help appreciated.

Albert


--
Albert Cardona
Molecular Cell Developmental Biology
University of California Los Angeles
Tel +1 310 2067376
Programming: http://www.ini.unizh.ch/~acardona/trakem2.html
Research: http://www.mcdb.ucla.edu/Research/Hartenstein/
Web design: http://www.pixelets.com


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 01:17 AM
Marc Herbert
 
Posts: n/a
Default Re: about monitoring the input stream

Albert Cardona <acardona@ini.phys.ethz.ch> writes:

> Following up from
> http://archives.postgresql.org/pgsql...7/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.



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:36 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com