WebSocket plugin for Jmeter

17,961

Solution 1

Link in your question looks to be not for jmeter plugin but for proxying module for Apache http server.
Correct link seems to be https://github.com/kawasima/jmeter-websocket - jmeter plugin for WebSocket protocol.

To use it you have to:

  • download project sources;
  • build ApacheJMeter_WebSocket.jar using maven;
  • place jar into $JMETER_HOME/lib/ext/ dir.

Jar files successfully built from sources using maven 3.0 (mvn validate compile package):

WebSocket Sampler available in the list of Samplers:

enter image description here

Solution 2

Here is another WebSocket plugin for JMeter. It supports the RFC6455 (v13) of the WebSocket protocol.

Link: https://github.com/maciejzaleski/JMeter

Features:

  • Supports HTTS/HTTPS (ws/wss) version of the WebSocket protocol
  • Option to ignore SSL certificate errors
  • Streaming allows for a single connection to remain open for the duration of the test
  • Response has to match predefined regular expression
  • Response timeout
  • Response message backlog (build the Sampler response from multiple server messages)
  • Connection could be closed if server sends a message matching predefined regular expression

Solution 3

Here is another (fairly new) JMeter WebSocket plugin: https://bitbucket.org/pjtr/jmeter-websocket-samplers.

See the readme for current features; it's still in active development.

Solution 4

I can`t comment previous post. But this plugin has one problem with concurency when running a large quantity of threads. I got this error:

[Problems]
 - Unexpected error: null
java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:953)
java.util.LinkedList$ListItr.next(LinkedList.java:886)
JMeter.plugins.functional.samplers.websocket.ServiceSocket.getResponseMessage(ServiceSocket.java:125)
JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:156)
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
java.lang.Thread.run(Thread.java:744)

So I just replaced one line in the ServiceSocket.java:

protected Deque<String> responeBacklog = new LinkedList<String>();

with this line:

Queue<String> responeBacklog = new ConcurrentLinkedQueue<String>();

It solved my problem :)

Share:
17,961
user2308299
Author by

user2308299

Updated on July 02, 2022

Comments

  • user2308299
    user2308299 almost 2 years

    Can someone share me a link with plugin sampler for Websocket protocol for JMeter?

    I tried to install from the link below: https://github.com/kawasima/mod_proxy_websocket.
    But not sure how to get that.

    I am new to the tool.
    Thanks and appreciated.

  • Dmitri T
    Dmitri T over 10 years
    Could you please add Ant/Maven/Ivy/whatever build system configuration so the one could build a jar from sources?
  • Maciej Zaleski
    Maciej Zaleski over 10 years
    I know I will have to do this at some point when I get some time. There is already build JAR under Releases which you can download and put into JMeter lib/ext folder. You will also need dependencies as per Wiki page.
  • Ahsan Zaheer
    Ahsan Zaheer over 10 years
    Maciej: your jar file didn't seem to work for me, can you help?
  • Dmitri T
    Dmitri T over 10 years
    I'm receiving following on attempt to use your plugin: - Unexpected error: null JMeter.plugins.functional.samplers.websocket.ServiceSocket.s‌​endMessage(ServiceSo‌​cket.java:131) JMeter.plugins.functional.samplers.websocket.WebSocketSample‌​r.sample(WebSocketSa‌​mpler.java:102) org.apache.jmeter.threads.JMeterThread.process_sampler(JMete‌​rThread.java:429) org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java‌​:257) java.lang.Thread.run(Thread.java:744)
  • Maciej Zaleski
    Maciej Zaleski over 10 years
    I suspect that there was either a connection problem (incorrect host name) or a race condition. In either case the problem should now be fixed and additional messages should shed more light on the problem. I will shortly release update on GitHub The sampler will show diagnostic messages when opened in the Results tree.
  • Dmitri T
    Dmitri T over 10 years
    Thanks a lot Maciej, version 1.0.1 works like a charm.
  • Arijeet Saha
    Arijeet Saha over 8 years
    Thor has a problem of closing the websocket conenction and not able to keep it idle. Loadtesting is difficult to acheive.
  • Praveen
    Praveen about 7 years
    Where is that file located?