Class AccessLogSampler
- All Implemented Interfaces:
Serializable,Cloneable,ConfigMergabilityIndicator,Replaceable,Searchable,HTTPConstantsInterface,Interruptible,Sampler,TestBean,org.apache.jmeter.testelement.TestElement,TestIterationListener,TestStateListener,ThreadListener
AccessLogSampler is responsible for a couple of things:
- creating instances of Generator
- creating instances of Parser
- triggering popup windows
- calling Generator.generateRequest()
- checking to make sure the classes are valid
- making sure a class can be instantiated
Some bugs only appear under production traffic, so it is useful to generate traffic using production logs. This way, JMeter can record when problems occur and provide a way to match the server logs.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
HTTPSamplerBase.SourceTypeNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion -
Field Summary
FieldsFields inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
ARGUMENTS, AUTH_MANAGER, AUTO_REDIRECTS, BROWSER_COMPATIBLE_MULTIPART, BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT, CACHE_MANAGER, CONCURRENT_DWN, CONCURRENT_POOL, CONCURRENT_POOL_SIZE, CONNECT_TIMEOUT, CONTENT_ENCODING, CONTENT_TYPE, COOKIE_MANAGER, DEFAULT_METHOD, DNS_CACHE_MANAGER, DO_MULTIPART_POST, DOMAIN, EMBEDDED_URL_EXCLUDE_RE, EMBEDDED_URL_RE, FOLLOW_REDIRECTS, HEADER_MANAGER, IMAGE_PARSER, IMPLEMENTATION, IP_SOURCE, IP_SOURCE_TYPE, KEYSTORE_CONFIG, MAX_FRAME_DEPTH, MAX_REDIRECTS, MD5, METHOD, MONITOR, NON_HTTP_RESPONSE_CODE, NON_HTTP_RESPONSE_MESSAGE, PATH, PORT, POST_BODY_RAW, POST_BODY_RAW_DEFAULT, PROTOCOL, PROXYHOST, PROXYPASS, PROXYPORT, PROXYSCHEME, PROXYUSER, RESPONSE_TIMEOUT, SAMPLE_TIMEOUT, SOURCE_TYPE_DEFAULT, UNSPECIFIED_PORT, UNSPECIFIED_PORT_AS_STRING, URL, URL_UNSPECIFIED_PORT, URL_UNSPECIFIED_PORT_AS_STRING, USE_KEEPALIVEFields inherited from interface org.apache.jmeter.protocol.http.util.HTTPConstantsInterface
APPLICATION_X_WWW_FORM_URLENCODED, CACHE_CONTROL, CONNECT, CONNECTION_CLOSE, COPY, DATE, DEFAULT_HTTP_PORT, DEFAULT_HTTP_PORT_STRING, DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_PORT_STRING, DELETE, ENCODING_BROTLI, ENCODING_DEFLATE, ENCODING_GZIP, ETAG, EXPIRES, GET, HEAD, HEADER_AUTHORIZATION, HEADER_CONNECTION, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, HEADER_COOKIE_IN_REQUEST, HEADER_HOST, HEADER_LOCAL_ADDRESS, HEADER_LOCATION, HEADER_SET_COOKIE, HTTP_1_1, IF_MODIFIED_SINCE, IF_NONE_MATCH, KEEP_ALIVE, LAST_MODIFIED, LOCK, MKCALENDAR, MKCOL, MOVE, MULTIPART_FORM_DATA, OPTIONS, PATCH, POST, PROPFIND, PROPPATCH, PROTOCOL_HTTP, PROTOCOL_HTTPS, PUT, REPORT, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_PERMANENT_REDIRECT, SC_SEE_OTHER, SC_TEMPORARY_REDIRECT, SEARCH, TRACE, TRANSFER_ENCODING, UNLOCK, VARYFields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Get the path where XML messages are stored.Get the file location of the xml file.Gets the protocol, with default.protected voidvoidMethod will instantiate the log parser based on the class in the text field.booleansample(Entry e) simply calls sample().sample gets a new HTTPSampler from the generator and calls it's sample() method.voidvoidsetFilterClassName(String filterClassName) voidsetImageParsing(boolean imageParsing) voidsetLogFile(String path) Set the path where XML messages are stored for random selection.voidsetParserClassName(String classname) it's kinda obvious, but we state it anyways.voidsetPortString(String port) voidsetProtocol(String value) Sets the scheme, with defaultvoidCalled once for all threads after the end of a test.voidCalled just before the start of the test from the main engine thread.voidCalled for each thread after all samples have been processed.Methods inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSampler
interrupt, sampleMethods inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
addArgument, addArgument, addEncodedArgument, addEncodedArgument, addEncodedArgument, addNonEncodedArgument, addNonEncodedArgument, addTestElement, applies, clearTestElementChildren, downloadPageResources, encodeBackSlashes, encodeSpaces, errorResult, followRedirects, getArguments, getAuthManager, getAutoRedirects, getCacheManager, getConcurrentPool, getConnectTimeout, getContentEncoding, getCookieManager, getDefaultPort, getDNSResolver, getDoBrowserCompatibleMultipart, getDoMultipart, getDoMultipartPost, getEmbeddedUrlRE, getEmbededUrlExcludeRE, getFollowRedirects, getHeaderManager, getHTTPFileCount, getHTTPFiles, getImplementation, getIpSource, getIpSourceType, getKeystoreConfig, getMethod, getMonitor, getPath, getPort, getPortIfSpecified, getPostBodyRaw, getProps, getProxyHost, getProxyPass, getProxyPortInt, getProxyScheme, getProxyUser, getQueryString, getQueryString, getResponseTimeout, getSchema, getSendFileAsPostBody, getSendParameterValuesAsPostBody, getSourceTypeList, getUrl, getUseKeepAlive, getUseMultipart, getUseMultipartForPost, getValidMethodsAsArray, hasArguments, isConcurrentDwn, isImageParser, isMonitor, isProtocolDefaultPort, isSecure, isSecure, isSuccessCode, parseArguments, parseArguments, readResponse, replace, resultProcessing, sample, setArguments, setAuthManager, setAutoRedirects, setCacheManager, setConcurrentDwn, setConcurrentPool, setConnectTimeout, setContentEncoding, setCookieManager, setDNSResolver, setDoBrowserCompatibleMultipart, setDoMultipart, setDoMultipartPost, setEmbeddedUrlExcludeRE, setEmbeddedUrlRE, setFollowRedirects, setHeaderManager, setHTTPFiles, setImageParser, setImplementation, setIpSource, setIpSourceType, setKeystoreConfig, setMD5, setMethod, setMonitor, setMonitor, setPath, setPath, setPort, setPostBodyRaw, setProxyHost, setProxyPass, setProxyPortInt, setProxyScheme, setProxyUser, setResponseTimeout, setUseKeepAlive, testEnded, testIterationStart, testStarted, threadStarted, toString, useMD5Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, 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.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElement
canRemove, clear, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, removeProperty, set, set, set, set, set, set, set, set, set, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverseMethods inherited from interface org.apache.jmeter.testelement.ThreadListener
threadStarted
-
Field Details
-
DEFAULT_CLASS
- See Also:
-
-
Constructor Details
-
AccessLogSampler
public AccessLogSampler()
-
-
Method Details
-
setLogFile
Set the path where XML messages are stored for random selection.- Parameters:
path- path where to store XML messages
-
getLogFile
Get the path where XML messages are stored. this is the directory where JMeter will randomly select a file.- Returns:
- path where XML messages are stored
-
setParserClassName
it's kinda obvious, but we state it anyways. Set the xml file with a string path.- Parameters:
classname- - parser class name
-
getParserClassName
Get the file location of the xml file.- Returns:
- String file path.
-
sampleWithParser
sample gets a new HTTPSampler from the generator and calls it's sample() method.- Returns:
- newly generated and called sample
-
sample
sample(Entry e) simply calls sample().- Specified by:
samplein interfaceSampler- Overrides:
samplein classHTTPSamplerBase- Parameters:
e- - ignored- Returns:
- the new sample
-
instantiateParser
public void instantiateParser()Method will instantiate the log parser based on the class in the text field. This was done to make it easier for people to plugin their own log parser and use different log parser. -
getFilterClassName
- Returns:
- Returns the filterClassName.
-
setFilterClassName
- Parameters:
filterClassName- The filterClassName to set.
-
getDomain
- Overrides:
getDomainin classHTTPSamplerBase- Returns:
- Returns the domain.
-
setDomain
- Overrides:
setDomainin classHTTPSamplerBase- Parameters:
domain- The domain to set.
-
isImageParsing
public boolean isImageParsing()- Returns:
- Returns the imageParsing.
-
setImageParsing
public void setImageParsing(boolean imageParsing) - Parameters:
imageParsing- The imageParsing to set.
-
getPortString
- Returns:
- Returns the port.
-
setPortString
- Parameters:
port- The port to set.
-
setProtocol
Sets the scheme, with default- Overrides:
setProtocolin classHTTPSamplerBase- Parameters:
value- the protocol
-
getProtocol
Gets the protocol, with default.- Overrides:
getProtocolin classHTTPSamplerBase- Returns:
- the protocol
-
initFilter
protected void initFilter() -
clone
- Specified by:
clonein interfaceorg.apache.jmeter.testelement.TestElement- Overrides:
clonein classAbstractTestElement
-
testEnded
public void testEnded()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.
- Specified by:
testEndedin interfaceTestStateListener- Overrides:
testEndedin classHTTPSamplerBase- See Also:
-
testStarted
public void testStarted()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.
- Specified by:
testStartedin interfaceTestStateListener- Overrides:
testStartedin classHTTPSamplerBase- See Also:
-
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:
threadFinishedin interfaceThreadListener- Overrides:
threadFinishedin classHTTPSamplerBase
-