Class SessionFilter
java.lang.Object
org.apache.jmeter.protocol.http.util.accesslog.SessionFilter
- All Implemented Interfaces:
Serializable, Cloneable, Filter, TestCloneable, ThreadListener
public class SessionFilter
extends Object
implements Filter, Serializable, TestCloneable, ThreadListener
Provides Session Filtering for the AccessLog Sampler.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, CookieManager> These objects are static across multiple threads in a test, via clone() method.protected CookieManagerprotected Set<CookieManager> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voidexcludeFiles(String[] filenames) Exclude all files in the arrayvoidexcludePattern(String[] regexp) Exclude any log entry that contains the following regular expression pattern.In case the user wants to replace the file extension, log parsers should call this method.protected CookieManagergetCookieManager(String ipAddr) protected StringgetIpAddress(String logLine) protected booleanhasExcPattern(String text) voidincludeFiles(String[] filenames) Include all files in the array.voidincludePattern(String[] regexp) Include any log entry that contains the following regular expression pattern.booleanisFiltered(String path, TestElement sampler) Log parser will call this method to see if a particular entry should be filtered or not.voidreset()Tell the filter when the parsing has reached the end of the log file and is about to begin again.voidsetReplaceExtension(String oldextension, String newextension) voidCalled for each thread after all samples have been processed.voidCalled for each thread before starting sampling.
-
Field Details
-
cookieManagers
These objects are static across multiple threads in a test, via clone() method. -
managersInUse
-
lastUsed
-
-
Constructor Details
-
SessionFilter
public SessionFilter()
-
-
Method Details
-
hasExcPattern
-
getIpAddress
-
reset
-
clone
- Specified by:
clonein interfaceTestCloneable- Overrides:
clonein classObject
-
excludeFiles
Exclude all files in the array- Specified by:
excludeFilesin interfaceFilter- Parameters:
filenames- names of files to exclude
-
excludePattern
Exclude any log entry that contains the following regular expression pattern.- Specified by:
excludePatternin interfaceFilter- Parameters:
regexp- list of regexp that match entries that should be excluded
-
filter
In case the user wants to replace the file extension, log parsers should call this method. This is useful for regression test plans. If a website is migrating from one platform to another and the file extension changes, the filter provides an easy way to do it without spending a lot of time. -
includeFiles
Include all files in the array.- Specified by:
includeFilesin interfaceFilter- Parameters:
filenames- names of files to include
-
includePattern
Include any log entry that contains the following regular expression pattern.- Specified by:
includePatternin interfaceFilter- Parameters:
regexp- list of regexp that match entries that should be included
-
isFiltered
Log parser will call this method to see if a particular entry should be filtered or not.- Specified by:
isFilteredin interfaceFilter- Parameters:
path- log line that should be checked if it should to be filtered outsampler-TestElementin which the line would be added- Returns:
- boolean
trueif line should be filtered out,falseotherwise
-
getCookieManager
-
setReplaceExtension
- Specified by:
setReplaceExtensionin interfaceFilter- Parameters:
oldextension- old extensionnewextension- new extension
-
threadFinished
public void threadFinished()Called for each thread after all samples have been processed.- Specified by:
threadFinishedin interfaceThreadListener- See Also:
-
threadStarted
public void threadStarted()Called 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.- Specified by:
threadStartedin interfaceThreadListener- See Also:
-