Class SessionFilter
java.lang.Object
org.apache.jmeter.protocol.http.util.accesslog.SessionFilter
- All Implemented Interfaces:
Serializable
,Cloneable
,Filter
,TestCloneable
,ThreadListener
@AutoService(Filter.class)
public class SessionFilter
extends Object
implements Filter, Serializable, TestCloneable, ThreadListener
Provides Session Filtering for the AccessLog Sampler.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a new SessionFilter and initializes its fields to new collectionsSessionFilter
(Map<String, CookieManager> cookieManagers, Set<CookieManager> managersInUse) Creates a new SessionFilter, but re-uses the given collections -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
excludeFiles
(String[] filenames) Exclude all files in the arrayvoid
excludePattern
(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 CookieManager
getCookieManager
(String ipAddr) protected static String
getIpAddress
(String logLine) protected boolean
hasExcPattern
(String text) void
includeFiles
(String[] filenames) Include all files in the array.void
includePattern
(String[] regexp) Include any log entry that contains the following regular expression pattern.boolean
isFiltered
(String path, org.apache.jmeter.testelement.TestElement sampler) Log parser will call this method to see if a particular entry should be filtered or not.void
reset()
Tell the filter when the parsing has reached the end of the log file and is about to begin again.void
setReplaceExtension
(String oldextension, String newextension) void
Called for each thread after all samples have been processed.void
Called for each thread before starting sampling.
-
Constructor Details
-
SessionFilter
public SessionFilter()Creates a new SessionFilter and initializes its fields to new collections -
SessionFilter
Creates a new SessionFilter, but re-uses the given collections- Parameters:
cookieManagers
-CookieManager
s to be used for the different IPsmanagersInUse
- CookieManagers currently in use by other threads
-
-
Method Details
-
hasExcPattern
-
getIpAddress
-
reset
public void reset()Tell the filter when the parsing has reached the end of the log file and is about to begin again. Gives the filter a chance to adjust it's values, if needed. -
clone
- Specified by:
clone
in interfaceTestCloneable
- Overrides:
clone
in classObject
-
excludeFiles
Exclude all files in the array- Specified by:
excludeFiles
in interfaceFilter
- Parameters:
filenames
- names of files to exclude
-
excludePattern
Exclude any log entry that contains the following regular expression pattern.- Specified by:
excludePattern
in 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:
includeFiles
in interfaceFilter
- Parameters:
filenames
- names of files to include
-
includePattern
Include any log entry that contains the following regular expression pattern.- Specified by:
includePattern
in 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:
isFiltered
in interfaceFilter
- Parameters:
path
- log line that should be checked if it should to be filtered outsampler
-TestElement
in which the line would be added- Returns:
- boolean
true
if line should be filtered out,false
otherwise
-
getCookieManager
-
setReplaceExtension
- Specified by:
setReplaceExtension
in interfaceFilter
- Parameters:
oldextension
- old extensionnewextension
- new extension
-
threadFinished
public void threadFinished()Called for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)- Specified by:
threadFinished
in interfaceThreadListener
-
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. See org.apache.jmeter.threads.JMeterThread#threadStarted()- Specified by:
threadStarted
in interfaceThreadListener
-