org.apache.commons.performance.dbcp
Class DBCPClientThread

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


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

Constructor Detail

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 iterations
minDelay - minimum delay time between client requests
maxDelay - maximum delay time between client requests
sigma - standard deviation of delay times between client requests
delayType - distribution of time between client requests
queryType - type of query
rampPeriod - rampup, rampdown period for cyclic load
peakPeriod - period of sustained peak for cyclic load
troughPeriod - period of sustained minimum load
cycleType - type of cycle for mean delay
rampType - type of ramp (linear or random jumps)
logger - common logger shared by all clients
dataSource - DataSource for connections
stats - Statistics container
Method Detail

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.