@AutoService(value=SamplerCreator.class) public class DefaultSamplerCreator extends AbstractSamplerCreator
DEFAULT_ENCODING_KEY, HTTP, HTTPS| Constructor and Description |
|---|
DefaultSamplerCreator() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
computeContentEncoding(HttpRequestHdr request,
Map<String,String> pageEncodings,
Map<String,String> formEncodings,
String urlWithoutQuery)
Computes content encoding from request and if not found uses pageEncoding
and formEncoding to see if URL was previously computed with a content type
|
protected void |
computeContentEncoding(HTTPSamplerBase sampler,
HttpRequestHdr request,
Map<String,String> pageEncodings,
Map<String,String> formEncodings)
Compute content encoding
|
protected void |
computeDomain(HTTPSamplerBase sampler,
HttpRequestHdr request)
Set domain on sampler
|
protected void |
computeFromHeader(HTTPSamplerBase sampler,
HttpRequestHdr request,
Map<String,String> pageEncodings,
Map<String,String> formEncodings)
Compute sampler information from Request Header
|
protected void |
computeFromPostBody(HTTPSamplerBase sampler,
HttpRequestHdr request)
Compute sampler information from Request Header
|
protected void |
computeMethod(HTTPSamplerBase sampler,
HttpRequestHdr request)
Set method on sampler
|
protected void |
computePath(HTTPSamplerBase sampler,
HttpRequestHdr request)
Set path on sampler
|
protected void |
computePort(HTTPSamplerBase sampler,
HttpRequestHdr request)
Set Port on sampler
|
protected void |
computeProtocol(HTTPSamplerBase sampler,
HttpRequestHdr request)
Set protocol on sampler
|
protected static void |
computeSamplerName(HTTPSamplerBase sampler,
HttpRequestHdr request)
Compute sampler name
|
HTTPSamplerBase |
createSampler(HttpRequestHdr request,
Map<String,String> pageEncodings,
Map<String,String> formEncodings)
Create HTTPSamplerBase
|
String[] |
getManagedContentTypes() |
static boolean |
isPotentialJson(String postData)
Tries parsing to see if content is JSON
|
void |
populateSampler(HTTPSamplerBase sampler,
HttpRequestHdr request,
Map<String,String> pageEncodings,
Map<String,String> formEncodings)
Populate sampler from request
|
createAndPopulateSampler, createChildren, getBinaryDirectory, getBinaryFileSuffix, getRequestNumber, incrementRequestNumber, incrementRequestNumberAndGet, isBinaryContent, isNumberRequests, postProcessSampler, setCounterpublic String[] getManagedContentTypes()
SamplerCreator.getManagedContentTypes()public HTTPSamplerBase createSampler(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
SamplerCreatorrequest - HttpRequestHdrpageEncodings - Map of page encodingsformEncodings - Map of form encodingsHTTPSamplerBaseSamplerCreator.createSampler(org.apache.jmeter.protocol.http.proxy.HttpRequestHdr,
java.util.Map, java.util.Map)public final void populateSampler(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws Exception
SamplerCreatorsampler - HTTPSamplerBaserequest - HttpRequestHdrpageEncodings - Map of page encodingsformEncodings - Map of form encodingsException - when something failsSamplerCreator.populateSampler(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase,
org.apache.jmeter.protocol.http.proxy.HttpRequestHdr, java.util.Map,
java.util.Map)protected void computeFromHeader(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws Exception
sampler - HTTPSamplerBaserequest - HttpRequestHdrpageEncodings - Map of page encodingsformEncodings - Map of form encodingsException - when something failsprotected void computeFromPostBody(HTTPSamplerBase sampler, HttpRequestHdr request) throws Exception
sampler - HTTPSamplerBaserequest - HttpRequestHdrException - when something failspublic static boolean isPotentialJson(String postData)
postData - Stringprotected static void computeSamplerName(HTTPSamplerBase sampler, HttpRequestHdr request)
sampler - HTTPSamplerBaserequest - HttpRequestHdrprotected void computePath(HTTPSamplerBase sampler, HttpRequestHdr request)
sampler - HTTPSamplerBaserequest - HttpRequestHdrprotected void computeContentEncoding(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws MalformedURLException
sampler - HTTPSamplerBaserequest - HttpRequestHdrpageEncodings - Map of page encodingsformEncodings - Map of form encodingsMalformedURLException - when no URL could be built from
sampler and requestprotected String computeContentEncoding(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings, String urlWithoutQuery)
request - HttpRequestHdrpageEncodings - Map of page encodingsformEncodings - Map of form encodingsurlWithoutQuery - the request URL without the query parametersprotected void computeProtocol(HTTPSamplerBase sampler, HttpRequestHdr request)
sampler - HTTPSamplerBaserequest - HttpRequestHdrprotected void computePort(HTTPSamplerBase sampler, HttpRequestHdr request)
sampler - HTTPSamplerBaserequest - HttpRequestHdrprotected void computeMethod(HTTPSamplerBase sampler, HttpRequestHdr request)
sampler - HTTPSamplerBaserequest - HttpRequestHdrprotected void computeDomain(HTTPSamplerBase sampler, HttpRequestHdr request)
sampler - HTTPSamplerBaserequest - HttpRequestHdrCopyright © 1998-2023 Apache Software Foundation. All Rights Reserved.