This class handles all saving of samples.
The class must be thread-safe because it is shared between threads (NoThreadClone).
getFilename
public String getFilename()
isErrorLogging
public boolean isErrorLogging()
isSampleWanted
public 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.
success
- is sample successful
- whether to log/display the sample
isSampleWanted
public 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.
success
- status of sampleerrorOnly
- if errors only wantedsuccessOnly
- if success only wanted
- whether to log/display the sample
isSuccessOnlyLogging
public boolean isSuccessOnlyLogging()
loadExistingFile
public void loadExistingFile()
Loads an existing sample data (JTL) file.
This can be one of:
- XStream format
- Avalon format
- CSV format
recordStats
public void recordStats(TestElement e)
throws Exception
recordStats is used to save statistics generated by visualizers
sampleOccurred
public void sampleOccurred(SampleEvent event)
When a test result is received, display it and save it.
- sampleOccurred in interface SampleListener
event
- the sample event that was received
sendToVisualizer
protected final void sendToVisualizer(SampleResult r)
setErrorLogging
public void setErrorLogging(boolean errorLogging)
setFilename
public void setFilename(String f)
Sets the filename attribute of the ResultCollector object.
f
- the new filename value
setSuccessOnlyLogging
public void setSuccessOnlyLogging(boolean value)