Class AccessLogSampler
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Cloneable
,org.apache.jmeter.engine.util.ConfigMergabilityIndicator
,org.apache.jmeter.gui.Replaceable
,org.apache.jmeter.gui.Searchable
,org.apache.jmeter.protocol.http.util.HTTPConstantsInterface
,org.apache.jmeter.samplers.Interruptible
,org.apache.jmeter.samplers.Sampler
,org.apache.jmeter.testbeans.TestBean
,org.apache.jmeter.testelement.TestElement
,org.apache.jmeter.testelement.TestIterationListener
,org.apache.jmeter.testelement.TestStateListener
,org.apache.jmeter.testelement.ThreadListener
public class AccessLogSampler extends HTTPSampler implements TestBean, ThreadListener
Description: 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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
DEFAULT_CLASS
public String
logFile
public String
parserClassName
public String
filterClassName
public final static String
ARGUMENTS
public final static String
AUTH_MANAGER
public final static String
COOKIE_MANAGER
public final static String
KEYSTORE_CONFIG
public final static String
SAMPLE_TIMEOUT
public final static String
CACHE_MANAGER
public final static String
HEADER_MANAGER
public final static String
DNS_CACHE_MANAGER
public final static String
DOMAIN
public final static String
PORT
public final static String
PROXYSCHEME
public final static String
PROXYHOST
public final static String
PROXYPORT
public final static String
PROXYUSER
public final static String
PROXYPASS
public final static String
CONNECT_TIMEOUT
public final static String
RESPONSE_TIMEOUT
public final static String
METHOD
public final static String
CONTENT_ENCODING
public final static String
IMPLEMENTATION
public final static String
PATH
public final static String
FOLLOW_REDIRECTS
public final static String
AUTO_REDIRECTS
public final static String
PROTOCOL
public final static String
URL
public final static String
IP_SOURCE
public final static String
IP_SOURCE_TYPE
public final static String
USE_KEEPALIVE
public final static String
DO_MULTIPART_POST
public final static String
BROWSER_COMPATIBLE_MULTIPART
public final static String
CONCURRENT_DWN
public final static String
CONCURRENT_POOL
public final static int
CONCURRENT_POOL_SIZE
public final static boolean
BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT
public final static int
SOURCE_TYPE_DEFAULT
public final static String
DEFAULT_METHOD
public final static String
CONTENT_TYPE
public final static String
IMAGE_PARSER
public final static String
EMBEDDED_URL_RE
public final static String
EMBEDDED_URL_EXCLUDE_RE
public final static String
MONITOR
public final static String
MD5
public final static int
UNSPECIFIED_PORT
public final static String
UNSPECIFIED_PORT_AS_STRING
public final static int
URL_UNSPECIFIED_PORT
public final static String
URL_UNSPECIFIED_PORT_AS_STRING
public final static String
POST_BODY_RAW
public final static boolean
POST_BODY_RAW_DEFAULT
public final static String
SC_MOVED_PERMANENTLY
public final static String
SC_MOVED_TEMPORARILY
public final static String
SC_SEE_OTHER
public final static String
SC_TEMPORARY_REDIRECT
public final static String
SC_PERMANENT_REDIRECT
public final static int
DEFAULT_HTTPS_PORT
public final static String
DEFAULT_HTTPS_PORT_STRING
public final static int
DEFAULT_HTTP_PORT
public final static String
DEFAULT_HTTP_PORT_STRING
public final static String
PROTOCOL_HTTP
public final static String
PROTOCOL_HTTPS
public final static String
HEAD
public final static String
POST
public final static String
PUT
public final static String
GET
public final static String
OPTIONS
public final static String
TRACE
public final static String
DELETE
public final static String
PATCH
public final static String
PROPFIND
public final static String
PROPPATCH
public final static String
MKCOL
public final static String
COPY
public final static String
MOVE
public final static String
LOCK
public final static String
UNLOCK
public final static String
CONNECT
public final static String
REPORT
public final static String
MKCALENDAR
public final static String
SEARCH
public final static String
HEADER_AUTHORIZATION
public final static String
HEADER_COOKIE
public final static String
HEADER_COOKIE_IN_REQUEST
public final static String
HEADER_CONNECTION
public final static String
CONNECTION_CLOSE
public final static String
KEEP_ALIVE
public final static String
TRANSFER_ENCODING
public final static String
HEADER_CONTENT_ENCODING
public final static String
HTTP_1_1
public final static String
HEADER_SET_COOKIE
public final static String
ENCODING_BROTLI
public final static String
ENCODING_DEFLATE
public final static String
ENCODING_GZIP
public final static String
HEADER_CONTENT_DISPOSITION
public final static String
HEADER_CONTENT_TYPE
public final static String
HEADER_CONTENT_LENGTH
public final static String
HEADER_HOST
public final static String
HEADER_LOCAL_ADDRESS
public final static String
HEADER_LOCATION
public final static String
APPLICATION_X_WWW_FORM_URLENCODED
public final static String
MULTIPART_FORM_DATA
public final static String
IF_NONE_MATCH
public final static String
IF_MODIFIED_SINCE
public final static String
ETAG
public final static String
LAST_MODIFIED
public final static String
EXPIRES
public final static String
CACHE_CONTROL
public final static String
DATE
public final static String
VARY
public transient JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
Constructor Summary
Constructors Constructor Description AccessLogSampler()
-
Method Summary
Modifier and Type Method Description String
getLogFile()
Get the path where XML messages are stored. void
setLogFile(String path)
Set the path where XML messages are stored for random selection. String
getParserClassName()
Get the file location of the xml file. void
setParserClassName(String classname)
it's kinda obvious, but we state it anyways. String
getFilterClassName()
void
setFilterClassName(String filterClassName)
SampleResult
sampleWithParser()
sample gets a new HTTPSampler from the generator and calls it's sample() method. SampleResult
sample(Entry e)
sample(Entry e) simply calls sample(). void
instantiateParser()
Method will instantiate the log parser based on the class in the text field. String
getDomain()
void
setDomain(String domain)
boolean
isImageParsing()
void
setImageParsing(boolean imageParsing)
String
getPortString()
void
setPortString(String port)
void
setProtocol(String value)
Sets the scheme, with default String
getProtocol()
Gets the protocol, with default. Object
clone()
void
testEnded()
void
testStarted()
void
threadFinished()
-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addTestElement, canRemove, clear, clearTestElementChildren, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Methods inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSampler
interrupt
-
Methods inherited from class org.apache.jmeter.testelement.ThreadListener
threadStarted
-
Methods inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
addArgument, addArgument, addEncodedArgument, addEncodedArgument, addEncodedArgument, addNonEncodedArgument, addNonEncodedArgument, addTestElement, applies, clearTestElementChildren, getArguments, getAuthManager, getAutoRedirects, getCacheManager, getConcurrentPool, getConnectTimeout, getContentEncoding, getCookieManager, getDNSResolver, getDefaultPort, getDoBrowserCompatibleMultipart, getDoMultipart, getDoMultipartPost, getEmbeddedUrlRE, getEmbededUrlExcludeRE, getFollowRedirects, getHTTPFileCount, getHTTPFiles, getHeaderManager, 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, parseArguments, parseArguments, readResponse, replace, sample, setArguments, setAuthManager, setAutoRedirects, setCacheManager, setConcurrentDwn, setConcurrentPool, setConnectTimeout, setContentEncoding, setCookieManager, setDNSResolver, setDoBrowserCompatibleMultipart, setDoMultipart, setDoMultipartPost, setEmbeddedUrlExcludeRE, setEmbeddedUrlRE, setFollowRedirects, setHTTPFiles, setHeaderManager, 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, useMD5
-
Methods inherited from class org.apache.jmeter.samplers.Interruptible
interrupt
-
Methods inherited from class org.apache.jmeter.samplers.AbstractSampler
applies
-
Methods inherited from class org.apache.jmeter.testelement.TestStateListener
testEnded, testStarted
-
Methods inherited from class org.apache.jmeter.testelement.TestIterationListener
testIterationStart
-
Methods inherited from class org.apache.jmeter.gui.Replaceable
replace
-
Methods inherited from class org.apache.jmeter.samplers.Sampler
sample
-
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getLogFile
String getLogFile()
Get the path where XML messages are stored. this is the directory where JMeter will randomly select a file.
-
setLogFile
void setLogFile(String path)
Set the path where XML messages are stored for random selection.
- Parameters:
path
- path where to store XML messages
-
getParserClassName
String getParserClassName()
Get the file location of the xml file.
-
setParserClassName
void setParserClassName(String classname)
it's kinda obvious, but we state it anyways. Set the xml file with a string path.
- Parameters:
classname
- - parser class name
-
getFilterClassName
String getFilterClassName()
-
setFilterClassName
void setFilterClassName(String filterClassName)
- Parameters:
filterClassName
- The filterClassName to set.
-
sampleWithParser
SampleResult sampleWithParser()
sample gets a new HTTPSampler from the generator and calls it's sample() method.
-
sample
SampleResult sample(Entry e)
sample(Entry e) simply calls sample().
- Parameters:
e
- - ignored
-
instantiateParser
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.
-
isImageParsing
boolean isImageParsing()
-
setImageParsing
void setImageParsing(boolean imageParsing)
- Parameters:
imageParsing
- The imageParsing to set.
-
getPortString
String getPortString()
-
setPortString
void setPortString(String port)
- Parameters:
port
- The port to set.
-
setProtocol
void setProtocol(String value)
Sets the scheme, with default
- Parameters:
value
- the protocol
-
getProtocol
String getProtocol()
Gets the protocol, with default.
-
testEnded
void testEnded()
-
testStarted
void testStarted()
-
threadFinished
void threadFinished()
-
-
-
-