This document introduces how to use JMeter to conduct WebSocket-based performance testing by introducing plugins.
Background
WebSocket is a common network communication protocol, and with the popularity of real-time web applications, ensuring WebSocket connection performance has become crucial. The WebSocket protocol for performance testing helps evaluate business performance under high load and high concurrent connections, ensuring good response speed and data transmission quality even when a large number of users are using it simultaneously.
Although JMeter does not natively support WebSocket-based performance testing, JMeter provides additional support for it through plugin extension. The most commonly used plugin is WebSocket Samplers by Peter Doornbosch. This plugin provides 6 samplers that can meet most WebSocket-based performance testing requirements.
Plugin Version
PTS supports WebSocket-based performance testing that provides the same user experience as native JMeter-based performance testing. The metric reporting configuration has been applied in the stable plugin version, jmeter-websocket-samplers-1.2.8.jar, to support data reporting during the performance testing. Note that the plugin version should be 1.2.8. Other versions may lack metric reporting configuration, leading to incomplete data. The plugin can be downloaded at the following link: https://bitbucket.org/pjtr/jmeter-websocket-samplers/downloads/?tab=downloads. Usage
Creating a JMeter-based Performance Testing Scenario
2. In the left sidebar, click PTS > Test Scenarios.
3. Click Create Scenario. On the Create Scenario page, select the testing scenario of the JMeter type.
Uploading the Performance Testing Files
1. Configure the performance testing plan in local JMeter according to business needs.
2. After the local debugging is successful, upload the corresponding JMX script, WebSocket plugin, and other necessary files to the console.
Running the Performance Testing Script
Click Save and Run in the upper right corner to start the performance testing task and generate a real-time report.
Viewing the Performance Testing Results
PTS has conducted event tracking for the results of each sampler in the WebSocket plugin. During the performance testing, you can view the performance testing data corresponding to different methods in the console according to business needs.