public class ResultCollector extends AbstractListenerElement implements SampleListener, Clearable, Serializable, TestStateListener, Remoteable, NoThreadClone
Modifier and Type | Field and Description |
---|---|
static String |
FILENAME |
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
ResultCollector()
No-arg constructor.
|
ResultCollector(Summariser summer)
Constructor which sets the used
Summariser |
Modifier and Type | Method and Description |
---|---|
void |
clearData()
Clears the current data of the object.
|
Object |
clone() |
void |
flushFile()
Flush PrintWriter to synchronize file contents
|
String |
getFilename()
Get the filename of the file this collector uses
|
SampleSaveConfiguration |
getSaveConfig() |
boolean |
isErrorLogging()
Get the state of error logging
|
boolean |
isSampleWanted(boolean success)
Decides whether or not to a sample is wanted based on:
errorOnly
successOnly
sample success
Should only be called for single samples.
|
static boolean |
isSampleWanted(boolean success,
boolean errorOnly,
boolean successOnly)
Decides whether or not to a sample is wanted based on:
errorOnly
successOnly
sample success
This version is intended to be called by code that loops over many samples;
it is cheaper than fetching the settings each time.
|
boolean |
isSuccessOnlyLogging()
Get the state of successful only logging
|
void |
loadExistingFile()
Loads an existing sample data (JTL) file.
|
void |
sampleOccurred(SampleEvent event)
When a test result is received, display it and save it.
|
void |
sampleStarted(SampleEvent e)
A sample has started.
|
void |
sampleStopped(SampleEvent e)
A sample has stopped.
|
protected void |
sendToVisualizer(SampleResult r) |
void |
setErrorLogging(boolean errorLogging)
Sets error logging flag
|
void |
setFilename(String f)
Sets the filename attribute of the ResultCollector object.
|
void |
setSaveConfig(SampleSaveConfiguration saveConfig) |
void |
setSuccessOnlyLogging(boolean value)
Sets the flag whether only successful samples should be logged
|
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(String host)
Called once for all threads after the end of a test.
|
void |
testStarted()
Called just before the start of the test from the main engine thread.
|
void |
testStarted(String host)
Called just before the start of the test from the main engine thread.
|
getVisualizer, setListener
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, 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, traverseProperty
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
removed
public static final String FILENAME
public ResultCollector()
public ResultCollector(Summariser summer)
Summariser
summer
- The Summariser
to usepublic Object clone()
clone
in interface TestElement
clone
in class AbstractListenerElement
public String getFilename()
public boolean isErrorLogging()
public final void setErrorLogging(boolean errorLogging)
errorLogging
- The flag whether errors should be loggedpublic final void setSuccessOnlyLogging(boolean value)
value
- The flag whether only successful samples should be loggedpublic boolean isSuccessOnlyLogging()
public boolean isSampleWanted(boolean success)
success
- is sample successfulpublic static boolean isSampleWanted(boolean success, boolean errorOnly, boolean successOnly)
success
- status of sampleerrorOnly
- if errors only wantedsuccessOnly
- if success only wantedpublic void setFilename(String f)
f
- the new filename valuepublic void testEnded(String host)
TestStateListener
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.
testEnded
in interface TestStateListener
host
- name of hostStandardJMeterEngine.stopTest()
public void testStarted(String host)
TestStateListener
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.
testStarted
in interface TestStateListener
host
- name of hostStandardJMeterEngine.run()
public void testEnded()
TestStateListener
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.
testEnded
in interface TestStateListener
StandardJMeterEngine.stopTest()
public void testStarted()
TestStateListener
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.
testStarted
in interface TestStateListener
StandardJMeterEngine.run()
public void loadExistingFile()
public void sampleStarted(SampleEvent e)
SampleListener
sampleStarted
in interface SampleListener
e
- the SampleEvent
that has startedpublic void sampleStopped(SampleEvent e)
SampleListener
sampleStopped
in interface SampleListener
e
- the SampleEvent
that has stoppedpublic void sampleOccurred(SampleEvent event)
sampleOccurred
in interface SampleListener
event
- the sample event that was receivedprotected final void sendToVisualizer(SampleResult r)
public void flushFile()
public SampleSaveConfiguration getSaveConfig()
public void setSaveConfig(SampleSaveConfiguration saveConfig)
saveConfig
- The saveConfig to set.Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.