org.apache.commons.performance.http
Class HttpClientThread

java.lang.Object
  extended by org.apache.commons.performance.ClientThread
      extended by 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.


Field Summary
 
Fields inherited from class org.apache.commons.performance.ClientThread
logger, PEAK_LOAD, RAMPING_DOWN, RAMPING_UP, randomData, stats, TROUGH_LOAD
 
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
 

Constructor Detail

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)
Method Detail

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.