You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Eugeny N Dzhurinsky <bo...@redwerk.com> on 2008/04/15 18:43:38 UTC

calculate bandwidth of HttpClient

Hello there!

Is there any way to get the bandwidth, used by HttpClient to download
pages?

Currently we are using version 3.0.1 of HttpClient, and we had implemented the
ProtocolSocketFactory which returns an instance of the custom Socket class,
which returns the InputStream which is able to return amount of bytes read
from the content stream. Knowing the amount of bytes and time of download, it
is trivial to calculate the bandwidth - however the real bandwidth on the
network interface is about 2 times more than reported by our application.

And we are sure there are no other network activity on the interface, and our
calculations seems to be right - the amount of downloaded data equals to the
amount of data saved to the persisted storage.

-- 
Eugene N Dzhurinsky

Re: calculate bandwidth of HttpClient

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2008-04-15 at 21:41 +0300, Eugeny N Dzhurinsky wrote:
> On Tue, Apr 15, 2008 at 07:49:12PM +0200, Oleg Kalnichevski wrote:
> > 
> > On Tue, 2008-04-15 at 19:43 +0300, Eugeny N Dzhurinsky wrote:
> > > Hello there!
> > > 
> > > Is there any way to get the bandwidth, used by HttpClient to download
> > > pages?
> > > 
> > > Currently we are using version 3.0.1 of HttpClient, and we had implemented the
> > > ProtocolSocketFactory which returns an instance of the custom Socket class,
> > > which returns the InputStream which is able to return amount of bytes read
> > > from the content stream. Knowing the amount of bytes and time of download, it
> > > is trivial to calculate the bandwidth - however the real bandwidth on the
> > > network interface is about 2 times more than reported by our application.
> > > 
> > > And we are sure there are no other network activity on the interface, and our
> > > calculations seems to be right - the amount of downloaded data equals to the
> > > amount of data saved to the persisted storage.
> > 
> > It is possible that the remote server is just not able to saturate all
> > available bandwidth.
> 
> Well, it does. For example, our application displays 1 mbit/seconds, but
> pktshow/trafshow displays 2 mbit/seconds of bandwidth usage on the physical
> interface. And we are absolutely sure there are no another application which
> are accessing network, also we are 99.9% sure there are no errors /
> miscalculations in our application - the things are pretty straightforward. 
> So the question for now is - are there any other ways to get the bandwidth
> usage information from HttpClient?

None I know of

>  And is the usage of ProtocolSocketFactory
> the recommended way to get such information?
> 

Yes, it is

Oleg

> Thank you in advance!
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: calculate bandwidth of HttpClient

Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
On Tue, Apr 15, 2008 at 07:49:12PM +0200, Oleg Kalnichevski wrote:
> 
> On Tue, 2008-04-15 at 19:43 +0300, Eugeny N Dzhurinsky wrote:
> > Hello there!
> > 
> > Is there any way to get the bandwidth, used by HttpClient to download
> > pages?
> > 
> > Currently we are using version 3.0.1 of HttpClient, and we had implemented the
> > ProtocolSocketFactory which returns an instance of the custom Socket class,
> > which returns the InputStream which is able to return amount of bytes read
> > from the content stream. Knowing the amount of bytes and time of download, it
> > is trivial to calculate the bandwidth - however the real bandwidth on the
> > network interface is about 2 times more than reported by our application.
> > 
> > And we are sure there are no other network activity on the interface, and our
> > calculations seems to be right - the amount of downloaded data equals to the
> > amount of data saved to the persisted storage.
> 
> It is possible that the remote server is just not able to saturate all
> available bandwidth.

Well, it does. For example, our application displays 1 mbit/seconds, but
pktshow/trafshow displays 2 mbit/seconds of bandwidth usage on the physical
interface. And we are absolutely sure there are no another application which
are accessing network, also we are 99.9% sure there are no errors /
miscalculations in our application - the things are pretty straightforward. 
So the question for now is - are there any other ways to get the bandwidth
usage information from HttpClient? And is the usage of ProtocolSocketFactory
the recommended way to get such information?

Thank you in advance!

-- 
Eugene N Dzhurinsky

Re: calculate bandwidth of HttpClient

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2008-04-15 at 19:43 +0300, Eugeny N Dzhurinsky wrote:
> Hello there!
> 
> Is there any way to get the bandwidth, used by HttpClient to download
> pages?
> 
> Currently we are using version 3.0.1 of HttpClient, and we had implemented the
> ProtocolSocketFactory which returns an instance of the custom Socket class,
> which returns the InputStream which is able to return amount of bytes read
> from the content stream. Knowing the amount of bytes and time of download, it
> is trivial to calculate the bandwidth - however the real bandwidth on the
> network interface is about 2 times more than reported by our application.
> 
> And we are sure there are no other network activity on the interface, and our
> calculations seems to be right - the amount of downloaded data equals to the
> amount of data saved to the persisted storage.
> 

It is possible that the remote server is just not able to saturate all
available bandwidth.

Oleg 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org