|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.reporters.AbstractListenerElement
org.apache.jmeter.reporters.ResultCollector
public class ResultCollector
This class handles all saving of samples. The class must be thread-safe because it is shared between threads (NoThreadClone).
Field Summary | |
---|---|
static String |
FILENAME
|
Fields inherited from interface org.apache.jmeter.testelement.TestElement |
---|
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS |
Constructor Summary | |
---|---|
ResultCollector()
No-arg constructor. |
|
ResultCollector(Summariser summer)
Constructor which sets the used Summariser |
Method Summary | |
---|---|
void |
clearData()
Clears the current data of the object. |
Object |
clone()
|
protected 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 |
recordStats(TestElement e)
recordStats is used to save statistics generated by visualizers |
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. |
Methods inherited from class org.apache.jmeter.reporters.AbstractListenerElement |
---|
getVisualizer, setListener |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FILENAME
Constructor Detail |
---|
public ResultCollector()
public ResultCollector(Summariser summer)
Summariser
summer
- The Summariser
to useMethod Detail |
---|
public 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 successful
public static boolean isSampleWanted(boolean success, boolean errorOnly, boolean successOnly)
success
- status of sampleerrorOnly
- if errors only wantedsuccessOnly
- if success only wanted
public 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 recordStats(TestElement e) throws IOException
e
- The data to save
IOException
- when data writing failsprotected void flushFile()
public SampleSaveConfiguration getSaveConfig()
public void setSaveConfig(SampleSaveConfiguration saveConfig)
saveConfig
- The saveConfig to set.public void clearData()
Clearable
clearData
in interface Clearable
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |