Class ResultCollector
- All Implemented Interfaces:
- Serializable,- Cloneable,- NoThreadClone,- Searchable,- Clearable,- Remoteable,- SampleListener,- org.apache.jmeter.testelement.TestElement,- TestStateListener
- Direct Known Subclasses:
- MailerResultCollector
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFieldsFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructorsConstructorDescriptionNo-arg constructor.ResultCollector(Summariser summer) Constructor which sets the usedSummariser
- 
Method SummaryModifier and TypeMethodDescriptionvoidClears the current data of the object.clone()voidFlush PrintWriter to synchronize file contentsGet the filename of the file this collector usesbooleanGet the state of error loggingbooleanisSampleWanted(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 booleanisSampleWanted(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.booleanGet the state of successful only loggingvoidLoads an existing sample data (JTL) file.voidsampleOccurred(SampleEvent event) When a test result is received, display it and save it.voidA sample has started.voidA sample has stopped.protected final voidfinal voidsetErrorLogging(boolean errorLogging) Sets error logging flagvoidSets the filename attribute of the ResultCollector object.voidsetSaveConfig(SampleSaveConfiguration saveConfig) final voidsetSuccessOnlyLogging(boolean value) Sets the flag whether only successful samples should be loggedvoidCalled once for all threads after the end of a test.voidCalled once for all threads after the end of a test.voidCalled just before the start of the test from the main engine thread.voidtestStarted(String host) Called just before the start of the test from the main engine thread.Methods inherited from class org.apache.jmeter.reporters.AbstractListenerElementgetVisualizer, setListenerMethods 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, set
- 
Field Details- 
FILENAME- See Also:
 
 
- 
- 
Constructor Details- 
ResultCollectorpublic ResultCollector()No-arg constructor.
- 
ResultCollectorConstructor which sets the usedSummariser- Parameters:
- summer- The- Summariserto use
 
 
- 
- 
Method Details- 
clone- Specified by:
- clonein interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clonein class- AbstractListenerElement
 
- 
getFilenameGet the filename of the file this collector uses- Returns:
- The name of the file
 
- 
isErrorLoggingpublic boolean isErrorLogging()Get the state of error logging- Returns:
- Flag whether errors should be logged
 
- 
setErrorLoggingpublic final void setErrorLogging(boolean errorLogging) Sets error logging flag- Parameters:
- errorLogging- The flag whether errors should be logged
 
- 
setSuccessOnlyLoggingpublic final void setSuccessOnlyLogging(boolean value) Sets the flag whether only successful samples should be logged- Parameters:
- value- The flag whether only successful samples should be logged
 
- 
isSuccessOnlyLoggingpublic boolean isSuccessOnlyLogging()Get the state of successful only logging- Returns:
- Flag whether only successful samples should be logged
 
- 
isSampleWantedpublic boolean isSampleWanted(boolean success) Decides whether or not to a sample is wanted based on:- errorOnly
- successOnly
- sample success
 - Parameters:
- success- is sample successful
- Returns:
- whether to log/display the sample
 
- 
isSampleWantedpublic static boolean isSampleWanted(boolean success, boolean errorOnly, boolean successOnly) Decides whether or not to a sample is wanted based on:- errorOnly
- successOnly
- sample success
 - Parameters:
- success- status of sample
- errorOnly- if errors only wanted
- successOnly- if success only wanted
- Returns:
- whether to log/display the sample
 
- 
setFilenameSets the filename attribute of the ResultCollector object.- Parameters:
- f- the new filename value
 
- 
testEndedDescription copied from interface:TestStateListenerCalled 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
- Parameters:
- host- name of host
- See Also:
 
- 
testStartedDescription copied from interface:TestStateListenerCalled 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
- Parameters:
- host- name of host
- See Also:
 
- 
testEndedpublic void testEnded()Description copied from interface:TestStateListenerCalled 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:
 
- 
testStartedpublic void testStarted()Description copied from interface:TestStateListenerCalled 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:
 
- 
loadExistingFilepublic void loadExistingFile()Loads an existing sample data (JTL) file. This can be one of:- XStream format
- CSV format
 
- 
sampleStartedDescription copied from interface:SampleListenerA sample has started.- Specified by:
- sampleStartedin interface- SampleListener
- Parameters:
- e- the- SampleEventthat has started
 
- 
sampleStoppedDescription copied from interface:SampleListenerA sample has stopped.- Specified by:
- sampleStoppedin interface- SampleListener
- Parameters:
- e- the- SampleEventthat has stopped
 
- 
sampleOccurredWhen a test result is received, display it and save it.- Specified by:
- sampleOccurredin interface- SampleListener
- Parameters:
- event- the sample event that was received
 
- 
sendToVisualizer
- 
flushFilepublic void flushFile()Flush PrintWriter to synchronize file contents
- 
getSaveConfig- Returns:
- Returns the saveConfig.
 
- 
setSaveConfig- Parameters:
- saveConfig- The saveConfig to set.
 
- 
clearDatapublic void clearData()Description copied from interface:ClearableClears the current data of the object.
 
-