org.rutil.loadtest
Class ThreadBoundLoadGenerator

java.lang.Object
  extended by org.rutil.loadtest.LoadGenerator
      extended by org.rutil.loadtest.ThreadBoundLoadGenerator

public class ThreadBoundLoadGenerator
extends LoadGenerator

A thread based implementation of LoadGenerator. The number of concurrent requests sent to the test runner = number of threads. Each thread executes the tests sequentially for a defined "duration" of time. There are two exit points for this load generator 1. Max Number of threads/Duration. Exits once it reaches max number of threads and after each of those threads have executed for the "duration" 2. Avg latency/Duration. Exits once the avg latency exceeds the avg threshold and after all the threads have executed for the "duration". This is useful to find the upper bound on the number of concurrent requests (threads) that a server can handle while maintianing latency at or below the defined threshold or to just throw a constant load on the server.

Author:
mohan

Field Summary
 
Fields inherited from class org.rutil.loadtest.LoadGenerator
durationInSecs, name, statsHandler, testRunner
 
Constructor Summary
ThreadBoundLoadGenerator(java.lang.String name, TestRunner testRunner)
           
 
Method Summary
protected  boolean continueTest(Stats stats)
           
protected  Stats doStart()
           
 int getInitialThreads()
           
 float getLatencyCutoffInMillis()
           
 int getMaxThreads()
           
 int getStepSize()
           
 boolean isRunSingleThreadTest()
           
 void setInitialThreads(int initialThreads)
           
 void setLatencyCutoffInMillis(float latencyCutoffInMillis)
           
 void setMaxThreads(int maxThreads)
           
 void setStepSize(int stepSize)
           
 java.lang.String toString()
           
 
Methods inherited from class org.rutil.loadtest.LoadGenerator
getDurationInSecs, getName, getStatsHandler, getTestRunner, isEnabled, setDurationInSecs, setEnabled, setStatsHandler, start, statsHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadBoundLoadGenerator

public ThreadBoundLoadGenerator(java.lang.String name,
                                TestRunner testRunner)
Method Detail

isRunSingleThreadTest

public boolean isRunSingleThreadTest()

getInitialThreads

public int getInitialThreads()

setInitialThreads

public void setInitialThreads(int initialThreads)

getMaxThreads

public int getMaxThreads()

setMaxThreads

public void setMaxThreads(int maxThreads)

getStepSize

public int getStepSize()

setStepSize

public void setStepSize(int stepSize)

getLatencyCutoffInMillis

public float getLatencyCutoffInMillis()

setLatencyCutoffInMillis

public void setLatencyCutoffInMillis(float latencyCutoffInMillis)

doStart

protected Stats doStart()
Specified by:
doStart in class LoadGenerator

continueTest

protected boolean continueTest(Stats stats)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object