org.apache.commons.performance.dbcp
Class DBCPClientThread
java.lang.Object
org.apache.commons.performance.ClientThread
org.apache.commons.performance.dbcp.DBCPClientThread
- All Implemented Interfaces:
- Runnable
public class DBCPClientThread
- extends ClientThread
Client thread that executes requests in a loop using a configured
DataSource, 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 |
DBCPClientThread(long iterations,
long minDelay,
long maxDelay,
double sigma,
String delayType,
String queryType,
long rampPeriod,
long peakPeriod,
long troughPeriod,
String cycleType,
String rampType,
Logger logger,
DataSource dataSource,
Statistics stats)
Create a dbcp client thread. |
Method Summary |
void |
cleanUp()
Close connection |
void |
execute()
Execute query |
void |
setUp()
Generate a random query |
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 |
DBCPClientThread
public DBCPClientThread(long iterations,
long minDelay,
long maxDelay,
double sigma,
String delayType,
String queryType,
long rampPeriod,
long peakPeriod,
long troughPeriod,
String cycleType,
String rampType,
Logger logger,
DataSource dataSource,
Statistics stats)
- Create a dbcp client thread.
- Parameters:
iterations
- number of iterationsminDelay
- minimum delay time between client requestsmaxDelay
- maximum delay time between client requestssigma
- standard deviation of delay times between client requestsdelayType
- distribution of time between client requestsqueryType
- type of queryrampPeriod
- rampup, rampdown period for cyclic loadpeakPeriod
- period of sustained peak for cyclic loadtroughPeriod
- period of sustained minimum loadcycleType
- type of cycle for mean delayrampType
- type of ramp (linear or random jumps)logger
- common logger shared by all clientsdataSource
- DataSource for connectionsstats
- Statistics container
setUp
public void setUp()
throws Exception
- Generate a random query
- Overrides:
setUp
in class ClientThread
- Throws:
Exception
execute
public void execute()
throws Exception
- Execute query
- Specified by:
execute
in class ClientThread
- Throws:
Exception
cleanUp
public void cleanUp()
throws Exception
- Close connection
- Overrides:
cleanUp
in class ClientThread
- Throws:
Exception
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.