org.apache.commons.performance.pool
Class PoolClientThread

java.lang.Object
  extended by org.apache.commons.performance.ClientThread
      extended by org.apache.commons.performance.pool.PoolClientThread
All Implemented Interfaces:
Runnable

public class PoolClientThread
extends ClientThread

Client thread that borrows and returns objects from a pool in a loop. 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, stats, TROUGH_LOAD
 
Constructor Summary
PoolClientThread(long iterations, long minDelay, long maxDelay, double sigma, String delayType, long rampPeriod, long peakPeriod, long troughPeriod, String cycleType, String rampType, Logger logger, Statistics stats, KeyedObjectPool keyedPool, double samplingRate)
          Create a pool client thread for a KeyedObjectPool.
PoolClientThread(long iterations, long minDelay, long maxDelay, double sigma, String delayType, long rampPeriod, long peakPeriod, long troughPeriod, String cycleType, String rampType, Logger logger, Statistics stats, ObjectPool pool, double samplingRate)
          Create a pool client thread for an ObjectPool.
 
Method Summary
protected  void cleanUp()
          Executed in finally block of iteration try-catch
 void execute()
          Borrow and return
protected  void finish()
          Executed once after the run finishes
 
Methods inherited from class org.apache.commons.performance.ClientThread
adjustState, computeCyclicDelay, 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, setUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolClientThread

public PoolClientThread(long iterations,
                        long minDelay,
                        long maxDelay,
                        double sigma,
                        String delayType,
                        long rampPeriod,
                        long peakPeriod,
                        long troughPeriod,
                        String cycleType,
                        String rampType,
                        Logger logger,
                        Statistics stats,
                        ObjectPool pool,
                        double samplingRate)
Create a pool client thread for an ObjectPool.

Parameters:
iterations - number of iterations
minDelay - minimum mean time between client requests
maxDelay - maximum mean time between client requests
delayType - distribution of time between client requests
rampPeriod - ramp period of cycle for cyclic load
peakPeriod - peak period of cycle for cyclic load
troughPeriod - trough period of cycle for cyclic load
cycleType - type of cycle for mean delay
rampType - type of ramp (linear or random jumps)
logger - common logger shared by all clients
stats - Statistics container
pool - ObjectPool

PoolClientThread

public PoolClientThread(long iterations,
                        long minDelay,
                        long maxDelay,
                        double sigma,
                        String delayType,
                        long rampPeriod,
                        long peakPeriod,
                        long troughPeriod,
                        String cycleType,
                        String rampType,
                        Logger logger,
                        Statistics stats,
                        KeyedObjectPool keyedPool,
                        double samplingRate)
Create a pool client thread for a KeyedObjectPool.

Parameters:
iterations - number of iterations
minDelay - minimum mean time between client requests
maxDelay - maximum mean time between client requests
delayType - distribution of time between client requests
rampPeriod - ramp period of cycle for cyclic load
peakPeriod - peak period of cycle for cyclic load
troughPeriod - trough period of cycle for cyclic load
cycleType - type of cycle for mean delay
rampType - type of ramp (linear or random jumps)
logger - common logger shared by all clients
stats - Statistics container
keyedPool - KeyedObjectPool
Method Detail

execute

public void execute()
             throws Exception
Borrow and return

Specified by:
execute in class ClientThread
Throws:
Exception

cleanUp

protected void cleanUp()
                throws Exception
Description copied from class: ClientThread
Executed in finally block of iteration try-catch

Overrides:
cleanUp in class ClientThread
Throws:
Exception

finish

protected void finish()
               throws Exception
Description copied from class: ClientThread
Executed once after the run finishes

Overrides:
finish in class ClientThread
Throws:
Exception


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.