public abstract class WebsocketSampler
extends org.apache.jmeter.samplers.AbstractSampler
implements org.apache.jmeter.testelement.ThreadListener
| Modifier and Type | Field and Description |
|---|---|
protected int |
connectTimeout |
protected org.apache.jmeter.protocol.http.control.CookieManager |
cookieManager |
static int |
DEFAULT_WS_PORT |
protected List<FrameFilter> |
frameFilters |
protected org.apache.jmeter.protocol.http.control.HeaderManager |
headerManager |
static int |
MAX_CONNECTION_TIMEOUT |
static int |
MAX_READ_TIMEOUT |
static int |
MIN_CONNECTION_TIMEOUT |
static int |
MIN_READ_TIMEOUT |
protected int |
readTimeout |
protected static ThreadLocal<WebSocketClient> |
threadLocalCachedConnection |
protected static boolean |
USE_CACHED_SSL_CONTEXT |
static String |
WS_THREAD_STOP_POLICY_PROPERTY |
| Constructor and Description |
|---|
WebsocketSampler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTestElement(org.apache.jmeter.testelement.TestElement element) |
void |
clearTestElementChildren() |
protected void |
dispose(WebSocketClient webSocketClient) |
protected abstract Frame |
doSample(WebSocketClient wsClient,
org.apache.jmeter.samplers.SampleResult result) |
String |
getConnectTimeout() |
protected String |
getConnectUrl(URL url) |
org.apache.jmeter.protocol.http.control.CookieManager |
getCookieManager() |
protected abstract org.apache.log.Logger |
getLogger() |
String |
getReadTimeout() |
boolean |
getTLS() |
protected void |
handleUnexpectedFrameException(UnexpectedFrameException e,
org.apache.jmeter.samplers.SampleResult result) |
protected void |
postProcessResponse(Frame response,
org.apache.jmeter.samplers.SampleResult result) |
protected abstract WebSocketClient |
prepareWebSocketClient(org.apache.jmeter.samplers.SampleResult result) |
protected void |
processDefaultReadResponse(DataFrame response,
boolean binary,
org.apache.jmeter.samplers.SampleResult result) |
protected Frame |
readFrame(WebSocketClient wsClient,
org.apache.jmeter.samplers.SampleResult result) |
protected Frame |
readFrame(WebSocketClient wsClient,
org.apache.jmeter.samplers.SampleResult result,
boolean binary) |
org.apache.jmeter.samplers.SampleResult |
sample(org.apache.jmeter.samplers.Entry entry) |
protected void |
sendFrame(WebSocketClient wsClient,
org.apache.jmeter.samplers.SampleResult result,
boolean binary,
String requestData,
File requestDataFile) |
void |
setConnectTimeout(String connectTimeout) |
void |
setReadTimeout(String readTimeout) |
void |
setTLS(boolean value) |
void |
threadFinished() |
void |
threadStarted() |
protected boolean |
useTLS() |
protected abstract String |
validateArguments() |
protected String |
validateConnectionTimeout(String value) |
protected String |
validatePortNumber(String value) |
protected String |
validateReadTimeout(String value) |
addPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, 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, traversePropertyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitcanRemove, clear, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traversepublic static final String WS_THREAD_STOP_POLICY_PROPERTY
public static final int MIN_CONNECTION_TIMEOUT
public static final int MAX_CONNECTION_TIMEOUT
public static final int MIN_READ_TIMEOUT
public static final int MAX_READ_TIMEOUT
public static final int DEFAULT_WS_PORT
protected static final boolean USE_CACHED_SSL_CONTEXT
protected static final ThreadLocal<WebSocketClient> threadLocalCachedConnection
protected org.apache.jmeter.protocol.http.control.HeaderManager headerManager
protected org.apache.jmeter.protocol.http.control.CookieManager cookieManager
protected List<FrameFilter> frameFilters
protected int readTimeout
protected int connectTimeout
protected abstract String validateArguments()
protected abstract WebSocketClient prepareWebSocketClient(org.apache.jmeter.samplers.SampleResult result)
public void clearTestElementChildren()
clearTestElementChildren in interface org.apache.jmeter.testelement.TestElementclearTestElementChildren in class org.apache.jmeter.testelement.AbstractTestElementpublic org.apache.jmeter.samplers.SampleResult sample(org.apache.jmeter.samplers.Entry entry)
sample in interface org.apache.jmeter.samplers.Samplerprotected abstract Frame doSample(WebSocketClient wsClient, org.apache.jmeter.samplers.SampleResult result) throws IOException, UnexpectedFrameException, SamplingAbortedException
protected void postProcessResponse(Frame response, org.apache.jmeter.samplers.SampleResult result)
protected void handleUnexpectedFrameException(UnexpectedFrameException e, org.apache.jmeter.samplers.SampleResult result)
protected void sendFrame(WebSocketClient wsClient, org.apache.jmeter.samplers.SampleResult result, boolean binary, String requestData, File requestDataFile) throws SamplingAbortedException, IOException
SamplingAbortedExceptionIOExceptionprotected Frame readFrame(WebSocketClient wsClient, org.apache.jmeter.samplers.SampleResult result, boolean binary) throws IOException, UnexpectedFrameException
IOExceptionUnexpectedFrameExceptionprotected Frame readFrame(WebSocketClient wsClient, org.apache.jmeter.samplers.SampleResult result) throws IOException, UnexpectedFrameException
IOExceptionUnexpectedFrameExceptionpublic void addTestElement(org.apache.jmeter.testelement.TestElement element)
addTestElement in interface org.apache.jmeter.testelement.TestElementaddTestElement in class org.apache.jmeter.testelement.AbstractTestElementpublic void threadStarted()
threadStarted in interface org.apache.jmeter.testelement.ThreadListenerpublic void threadFinished()
threadFinished in interface org.apache.jmeter.testelement.ThreadListenerpublic org.apache.jmeter.protocol.http.control.CookieManager getCookieManager()
protected void processDefaultReadResponse(DataFrame response, boolean binary, org.apache.jmeter.samplers.SampleResult result)
protected void dispose(WebSocketClient webSocketClient)
protected boolean useTLS()
public String getConnectTimeout()
public void setConnectTimeout(String connectTimeout)
public String getReadTimeout()
public void setReadTimeout(String readTimeout)
public boolean getTLS()
public void setTLS(boolean value)
protected abstract org.apache.log.Logger getLogger()