You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Rushabh Doshi <as...@hotmail.com> on 2022/12/14 11:23:27 UTC

Performance test on WebSocket.

Hi All,


We need to do performance testing for Viewer (PDFTron viewer) functionality for that we make WebSocket call to get some file data which requires multiple requests and responses within single connection of a WebSocket.


So, I have tried to use WebSocket Sampler by using JMeter plugins manager but getting response like - Cannot connect to the remote server​

------------------------------------------------------------------------------------------------------

SAMPLER RESULT

[Execution Flow]

 - Opening new connection

 - Using response message pattern ""

 - Using disconnect pattern ""

 - Waiting for the server connection for 5000 MILLISECONDS

 - Cannot connect to the remote server

 [Variables]

 - Message count: 0

 [Problems]

 - Unexpected error: null

JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:189)

JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:141)

org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)

org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)

org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)

org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)

java.lang.Thread.run(Unknown Source)
------------------------------------------------------------------------------------------------------


So, how can we achieve multiple requests within same WebSocket connection? Could you guide me on this please?


Thanks,
Rushabh

Re: Performance test on WebSocket.

Posted by Rushabh Doshi <as...@hotmail.com>.
It worked for me.

Thanks a lot!
________________________________
From: Dmitri Tikhanski <gl...@live.com>
Sent: Wednesday, December 14, 2022 5:03 PM
To: JMeter Users List <us...@jmeter.apache.org>; Rushabh Doshi <as...@hotmail.com>
Subject: Re: Performance test on WebSocket.

Rushabh Doshi wrote:

Hi All,


We need to do performance testing for Viewer (PDFTron viewer) functionality for that we make WebSocket call to get some file data which requires multiple requests and responses within single connection of a WebSocket.


So, I have tried to use WebSocket Sampler by using JMeter plugins manager but getting response like - Cannot connect to the remote server​

------------------------------------------------------------------------------------------------------

SAMPLER RESULT

[Execution Flow]

 - Opening new connection

 - Using response message pattern ""

 - Using disconnect pattern ""

 - Waiting for the server connection for 5000 MILLISECONDS

 - Cannot connect to the remote server

 [Variables]

 - Message count: 0

 [Problems]

 - Unexpected error: null

JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:189)

JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:141)

org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)

org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)

org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)

org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)

java.lang.Thread.run(Unknown Source)
------------------------------------------------------------------------------------------------------


So, how can we achieve multiple requests within same WebSocket connection? Could you guide me on this please?


Thanks,
Rushabh


Try switching to JMeter WebSocket Samplers by Peter Doornbosch<https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/>

The project is more "alive" and samplers have more features.

You will have an open connection sampler which allows explicitly opening a websocket connection, single read, single write and request/response samplers with possibility to re-use the existing connection and close connection sampler when you don't need the connection anymore.

Basic request-response sample with explicit open.jmx<https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/samples/Basic%20request-response%20sample%20with%20explicit%20open.jmx> sample test plan demonstrates the usage.

More information just in case: JMeter WebSocket Samplers - A Practical Guide <https://www.blazemeter.com/blog/jmeter-websocket-samplers>


Re: Performance test on WebSocket.

Posted by Dmitri Tikhanski <gl...@live.com>.
Rushabh Doshi wrote:
> Hi All,
>
>
> We need to do performance testing for Viewer (PDFTron viewer) functionality for that we make WebSocket call to get some file data which requires multiple requests and responses within single connection of a WebSocket.
>
>
> So, I have tried to use WebSocket Sampler by using JMeter plugins manager but getting response like - Cannot connect to the remote server​
>
> ------------------------------------------------------------------------------------------------------
>
> SAMPLER RESULT
>
> [Execution Flow]
>
>   - Opening new connection
>
>   - Using response message pattern ""
>
>   - Using disconnect pattern ""
>
>   - Waiting for the server connection for 5000 MILLISECONDS
>
>   - Cannot connect to the remote server
>
>   [Variables]
>
>   - Message count: 0
>
>   [Problems]
>
>   - Unexpected error: null
>
> JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:189)
>
> JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:141)
>
> org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
>
> org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
>
> org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
>
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
>
> java.lang.Thread.run(Unknown Source)
> ------------------------------------------------------------------------------------------------------
>
>
> So, how can we achieve multiple requests within same WebSocket connection? Could you guide me on this please?
>
>
> Thanks,
> Rushabh
Try switching to JMeter WebSocket Samplers by Peter Doornbosch 
<https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/>

The project is more "alive" and samplers have more features.

You will have an *open connection sampler***which allows explicitly 
opening a websocket connection, *single read, single write and 
request/response* samplers with possibility to re-use the existing 
connection and *close connection sampler* when you don't need the 
connection anymore.

Basic request-response sample with explicit open.jmx 
<https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/samples/Basic%20request-response%20sample%20with%20explicit%20open.jmx> 
sample test plan demonstrates the usage.

More information just in case: JMeter WebSocket Samplers - A Practical 
Guide <https://www.blazemeter.com/blog/jmeter-websocket-samplers>