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 StringDEFAULT_CLASSpublic StringlogFilepublic StringparserClassNamepublic StringfilterClassNamepublic final static StringARGUMENTSpublic final static StringAUTH_MANAGERpublic final static StringCOOKIE_MANAGERpublic final static StringKEYSTORE_CONFIGpublic final static StringSAMPLE_TIMEOUTpublic final static StringCACHE_MANAGERpublic final static StringHEADER_MANAGERpublic final static StringDNS_CACHE_MANAGERpublic final static StringDOMAINpublic final static StringPORTpublic final static StringPROXYSCHEMEpublic final static StringPROXYHOSTpublic final static StringPROXYPORTpublic final static StringPROXYUSERpublic final static StringPROXYPASSpublic final static StringCONNECT_TIMEOUTpublic final static StringRESPONSE_TIMEOUTpublic final static StringMETHODpublic final static StringCONTENT_ENCODINGpublic final static StringIMPLEMENTATIONpublic final static StringPATHpublic final static StringFOLLOW_REDIRECTSpublic final static StringAUTO_REDIRECTSpublic final static StringPROTOCOLpublic final static StringURLpublic final static StringIP_SOURCEpublic final static StringIP_SOURCE_TYPEpublic final static StringUSE_KEEPALIVEpublic final static StringDO_MULTIPART_POSTpublic final static StringBROWSER_COMPATIBLE_MULTIPARTpublic final static StringCONCURRENT_DWNpublic final static StringCONCURRENT_POOLpublic final static intCONCURRENT_POOL_SIZEpublic final static booleanBROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULTpublic final static intSOURCE_TYPE_DEFAULTpublic final static StringDEFAULT_METHODpublic final static StringCONTENT_TYPEpublic final static StringIMAGE_PARSERpublic final static StringEMBEDDED_URL_REpublic final static StringEMBEDDED_URL_EXCLUDE_REpublic final static StringMONITORpublic final static StringMD5public final static intUNSPECIFIED_PORTpublic final static StringUNSPECIFIED_PORT_AS_STRINGpublic final static intURL_UNSPECIFIED_PORTpublic final static StringURL_UNSPECIFIED_PORT_AS_STRINGpublic final static StringPOST_BODY_RAWpublic final static booleanPOST_BODY_RAW_DEFAULTpublic final static StringSC_MOVED_PERMANENTLYpublic final static StringSC_MOVED_TEMPORARILYpublic final static StringSC_SEE_OTHERpublic final static StringSC_TEMPORARY_REDIRECTpublic final static StringSC_PERMANENT_REDIRECTpublic final static intDEFAULT_HTTPS_PORTpublic final static StringDEFAULT_HTTPS_PORT_STRINGpublic final static intDEFAULT_HTTP_PORTpublic final static StringDEFAULT_HTTP_PORT_STRINGpublic final static StringPROTOCOL_HTTPpublic final static StringPROTOCOL_HTTPSpublic final static StringHEADpublic final static StringPOSTpublic final static StringPUTpublic final static StringGETpublic final static StringOPTIONSpublic final static StringTRACEpublic final static StringDELETEpublic final static StringPATCHpublic final static StringPROPFINDpublic final static StringPROPPATCHpublic final static StringMKCOLpublic final static StringCOPYpublic final static StringMOVEpublic final static StringLOCKpublic final static StringUNLOCKpublic final static StringCONNECTpublic final static StringREPORTpublic final static StringMKCALENDARpublic final static StringSEARCHpublic final static StringHEADER_AUTHORIZATIONpublic final static StringHEADER_COOKIEpublic final static StringHEADER_COOKIE_IN_REQUESTpublic final static StringHEADER_CONNECTIONpublic final static StringCONNECTION_CLOSEpublic final static StringKEEP_ALIVEpublic final static StringTRANSFER_ENCODINGpublic final static StringHEADER_CONTENT_ENCODINGpublic final static StringHTTP_1_1public final static StringHEADER_SET_COOKIEpublic final static StringENCODING_BROTLIpublic final static StringENCODING_DEFLATEpublic final static StringENCODING_GZIPpublic final static StringHEADER_CONTENT_DISPOSITIONpublic final static StringHEADER_CONTENT_TYPEpublic final static StringHEADER_CONTENT_LENGTHpublic final static StringHEADER_HOSTpublic final static StringHEADER_LOCAL_ADDRESSpublic final static StringHEADER_LOCATIONpublic final static StringAPPLICATION_X_WWW_FORM_URLENCODEDpublic final static StringMULTIPART_FORM_DATApublic final static StringIF_NONE_MATCHpublic final static StringIF_MODIFIED_SINCEpublic final static StringETAGpublic final static StringLAST_MODIFIEDpublic final static StringEXPIRESpublic final static StringCACHE_CONTROLpublic final static StringDATEpublic final static StringVARYpublic transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description AccessLogSampler()
-
Method Summary
Modifier and Type Method Description StringgetLogFile()Get the path where XML messages are stored. voidsetLogFile(String path)Set the path where XML messages are stored for random selection. StringgetParserClassName()Get the file location of the xml file. voidsetParserClassName(String classname)it's kinda obvious, but we state it anyways. StringgetFilterClassName()voidsetFilterClassName(String filterClassName)SampleResultsampleWithParser()sample gets a new HTTPSampler from the generator and calls it's sample() method. SampleResultsample(Entry e)sample(Entry e) simply calls sample(). voidinstantiateParser()Method will instantiate the log parser based on the class in the text field. StringgetDomain()voidsetDomain(String domain)booleanisImageParsing()voidsetImageParsing(boolean imageParsing)StringgetPortString()voidsetPortString(String port)voidsetProtocol(String value)Sets the scheme, with default StringgetProtocol()Gets the protocol, with default. Objectclone()voidtestEnded()voidtestStarted()voidthreadFinished()-
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()
-
-
-
-