Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id ED92A63309E for ; Fri, 18 Dec 2009 03:59:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73234-09 for ; Fri, 18 Dec 2009 07:59:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id 69C846315D5 for ; Fri, 18 Dec 2009 03:59:47 -0400 (AST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id CAD6E1E043B; Fri, 18 Dec 2009 15:59:45 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pZlYhruj2Itl; Fri, 18 Dec 2009 15:59:44 +0800 (WST) Received: from [10.1.1.6] (124-169-133-89.dyn.iinet.net.au [124.169.133.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id E7E4D1E043A; Fri, 18 Dec 2009 15:59:43 +0800 (WST) Message-ID: <4B2B366C.7010304@postnewspapers.com.au> Date: Fri, 18 Dec 2009 15:59:40 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Alexander Pyhalov CC: dmp , pgsql-jdbc@postgresql.org Subject: Re: Get bytes sent to client References: <4B2894E7.80407@rsu.ru> <4B28A86A.3060506@rsu.ru> <4B290928.5080004@ttc-cmc.net> <4B291141.90503@rsu.ru> <4B29D2A3.6050504@postnewspapers.com.au> <4B2B228C.8070008@rsu.ru> In-Reply-To: <4B2B228C.8070008@rsu.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 200912/55 X-Sequence-Number: 20136 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