hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Bandwidth Throttling?
Date Tue, 21 Feb 2006 10:50:50 GMT
On 20/02/06, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Sun, 2006-02-19 at 02:50 -0800, Travis Bear wrote:
> > Sorry if this is a newb question.  Web searches have returned no satisfactory answers.
> >
> >  I'm running a test app with hundreds of threads that each generate HTTP requests.
 Is there some mechanism that exists to cap the bandwidwitdh used by each thread in order
to simulate slower connections?
> >
> >  If this doesn't exist already, I will have to write something to do it.  In tis
case would there be interest in including this feature in HttpClient?
> >
> >  Thanks!
> >
> >
> >  -Travis
> >
>
> Travis,
>
> HttpClient does not support bandwidth throttling out of the box, however
> it should not be that difficult to implement a custom socket factory
> that is bandwidth throttling capable.
>
> I believe Sebastian of the JMeter fame has implemented something of that
> sort for Jakarta JMeter. JMeter dev list should be the right place to
> ask around
>

FYI: I added a "Slow Socket" implementation for use with HttpClient.

See

org/apache/jmeter/util/SlowSocket.java
under src/core
and

org/apache/jmeter/protocol/http/util/SlowHttpClientSocketFactory.java
under
src/protocol/http

The code is invoked by

Protocol.registerProtocol(PROTOCOL_HTTP,
                new Protocol(PROTOCOL_HTTP,
                new SlowHttpClientSocketFactory(cps),
                DEFAULT_HTTP_PORT));

Would there be any interest in adding this to HttpClient, perhaps as a
contrib item?

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


Mime
View raw message