Package org.apache.jmeter.timers
Class SyncTimer
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.timers.SyncTimer
- All Implemented Interfaces:
- Serializable,- Cloneable,- Searchable,- TestBean,- org.apache.jmeter.testelement.TestElement,- TestStateListener,- ThreadListener,- Timer
public class SyncTimer
extends AbstractTestElement
implements Timer, Serializable, TestBean, TestStateListener, ThreadListener
The purpose of the SyncTimer is to block threads until X number of threads
 have been blocked, and then they are all released at once. A SyncTimer can
 thus create large instant loads at various points of the test plan.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()We have to control the cloning process because we need some cross-thread communication if our synctimers are to be able to determine when to block and when to release.longdelay()This method is called after a sampling process is done to know how much time the sampling thread has to wait until sampling again.intlongvoidsetGroupSize(int numThreads) voidsetTimeoutInMs(long timeoutInMs) voidCalled once for all threads after the end of a test.voidReset timerCountervoidCalled just before the start of the test from the main engine thread.voidtestStarted(String host) Reset timerCountervoidCalled for each thread after all samples have been processed.voidCalled for each thread before starting sampling.Methods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementget, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getProps, getSchema, getString, removed, removeProperty, set, set, set, set, set, set, set, set, setMethods inherited from interface org.apache.jmeter.timers.TimerisModifiable
- 
Constructor Details- 
SyncTimerpublic SyncTimer()
 
- 
- 
Method Details- 
getGroupSizepublic int getGroupSize()- Returns:
- Returns the numThreads.
 
- 
setGroupSizepublic void setGroupSize(int numThreads) - Parameters:
- numThreads- The numThreads to set.
 
- 
delaypublic long delay()This method is called after a sampling process is done to know how much time the sampling thread has to wait until sampling again.
- 
cloneWe have to control the cloning process because we need some cross-thread communication if our synctimers are to be able to determine when to block and when to release.- Specified by:
- clonein interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clonein class- AbstractTestElement
 
- 
testEndedpublic void testEnded()Called once for all threads after the end of a test. This will use the same element instances as at the start of the test. N.B. testStarted() and testEnded() are called from different threads. - Specified by:
- testEndedin interface- TestStateListener
- See Also:
 
- 
testEndedReset timerCounter- Specified by:
- testEndedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testStartedpublic void testStarted()Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point. N.B. testStarted() and testEnded() are called from different threads. - Specified by:
- testStartedin interface- TestStateListener
- See Also:
 
- 
testStartedReset timerCounter- Specified by:
- testStartedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
threadStartedpublic void threadStarted()Description copied from interface:ThreadListenerCalled for each thread before starting sampling. WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet. See org.apache.jmeter.threads.JMeterThread#threadStarted()- Specified by:
- threadStartedin interface- ThreadListener
 
- 
threadFinishedpublic void threadFinished()Description copied from interface:ThreadListenerCalled for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)- Specified by:
- threadFinishedin interface- ThreadListener
 
- 
getTimeoutInMspublic long getTimeoutInMs()- Returns:
- the timeoutInMs
 
- 
setTimeoutInMspublic void setTimeoutInMs(long timeoutInMs) - Parameters:
- timeoutInMs- the timeoutInMs to set
 
 
-