org.apache.commons.performance.http
Class HttpClientThread
java.lang.Object
org.apache.commons.performance.ClientThread
org.apache.commons.performance.http.HttpClientThread
- All Implemented Interfaces:
- Runnable
public class HttpClientThread
- extends ClientThread
Client thread that executes http requests in a loop against a configured
url, with the number of requests, time between requests and
query strings governed by constructor parameters. See
ClientThread javadoc
for a description
of how times between requests are computed.
Constructor Summary |
HttpClientThread(long iterations,
long minDelay,
long maxDelay,
double sigma,
String delayType,
long rampPeriod,
long peakPeriod,
long troughPeriod,
String cycleType,
String rampType,
Logger logger,
Statistics stats,
String url,
String method,
int socketTimeout,
String successKey)
|
Method Summary |
void |
cleanUp()
Release http connection |
void |
execute()
Execute the http method against the target url. |
void |
setUp()
Nothing to do here at this point |
Methods inherited from class org.apache.commons.performance.ClientThread |
adjustState, computeCyclicDelay, finish, getCycleState, getCycleType, getDelayType, getIterations, getLastMean, getMaxDelay, getMinDelay, getNumErrors, getNumMisses, getPeakPeriod, getPeriodStart, getRampPeriod, getRampType, getSigma, getStartTime, getStats, getTroughPeriod, init, nextDelay, run, setCycleState, setDelayType, setLastMean, setMaxDelay, setMinDelay, setNumErrors, setNumMisses, setPeakPeriod, setPeriodStart, setRampPeriod, setRampType, setSigma, setStartTime, setTroughPeriod |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpClientThread
public HttpClientThread(long iterations,
long minDelay,
long maxDelay,
double sigma,
String delayType,
long rampPeriod,
long peakPeriod,
long troughPeriod,
String cycleType,
String rampType,
Logger logger,
Statistics stats,
String url,
String method,
int socketTimeout,
String successKey)
setUp
public void setUp()
throws Exception
- Nothing to do here at this point
- Overrides:
setUp
in class ClientThread
- Throws:
Exception
execute
public void execute()
throws Exception
- Execute the http method against the target url.
Throws HttpException if something other than 200 status is returned
or if there is a successKey configured and the response does not contain
the specified key.
- Specified by:
execute
in class ClientThread
- Throws:
Exception
cleanUp
public void cleanUp()
throws Exception
- Release http connection
- Overrides:
cleanUp
in class ClientThread
- Throws:
Exception
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.