This plugin allows you to test your SignalR app server, including those using Azure SignalR service.
Java 8 supported
Both the SignalR plugin and JMeter are compatible with JDK 8. But JDK 17 is recommended.
- Download Jmeter SignalR plugin (JmeterSignalR.jar). Place the jar in JMeter's lib/ext folder.
- Clone this repo and start the SignalR server in the examples/SignalRServer folder.
- Launch JMeter and load the SignalR.jmx script in the examples folder.
- Click start to begin .
-
In Azure Load Testing, create a test and select "Upload a JMeter Script".
-
Upload the JMeter script and SignalR plugin.
-
Override parameters as needed:
webAppUrl, connectionCountTotal, groupSize, sendDelayInMilliSeconds, payloadSizeInBytes
-
Start the test and view the metrics.
- Clone the repo and modify the code as needed.
- Build the jar using:
- Windows:
.\gradlew.bat jar
- Linux/MacOS:
./gradle jar
- Windows:
- Find the built
JmeterSignalR.jar
inbuild/libs
. - Enable the disabled SendToGroup Java + GUI.
- JMeter: An open-source benchmark tool, available in GUI and command-line modes. The GUI mode is useful for local debugging and modifying JMeter scripts but is less efficient than the command-line mode, which is more suitable for intense benchmark.
- JMeter plugin: Extends JMeter's capabilities by loading jars in the lib/ext folder. These jars usually include samplers, controllers, GUI components, helper functions, and other dependencies.
- Azure Load Testing: A service supporting JMeter engine, designed for easy execution of benchmarks across multiple JMeter instances. It integrates with Azure Monitor, providing a dashboard for nice metrics of JMeter results.
- SignalR client integration: This plugin overcomes JMeter's lack of native support for the SignalR client. It simplifies the testing against SignalR or Azure SignalR services by adding SignalR dependencies into the plugin jar, avoiding the need for workarounds like using a websocket plugin.
- Asynchronous metrics collection: Adapts to the bi-directional nature of the SignalR protocol, which is different
from the traditional HTTP request-response model. It buffers
SampleResult
in a memory queue before batching them to JMeter listeners. - Connection aggregation: To optimize performance, the plugin aggregates multiple connections into a single JMeter
thread using a
ConnectionBundle
class. This approach significantly reduces CPU overhead from thread context switching, especially valuable when connection counts reach several hundred. In Azure Load Testing, it allows the testing of up to 4000 connections per instance with just 1 virtual user. - Customization through JSR223 sampler: Offers flexibility in customizing the SignalR client using the JSR223 sampler, where groovy is the preferred scripting language. This feature enables users to alter client configurations and callbacks in the JMeter GUI.
- The
examples
folder: Contains a compatible SignalR server and a JMeter script for immediate use and testing. - Under
src/main/java/azure/signalr/groovy
: Houses groovy scripts identical to those in the JMeter script. - Under
src/main/java/azure/signalr/java
: Java version for the JSR223 sampler. Those who prefer Java over groovy can modify these Java files and rebuild the plugin, then assemble the flow ( e.g.,connect -> JoinGroup -> Send Message -> collect metrics
) using GUI. - Under
src/main/java/azure/signalr
,ConnectionBundle
class wraps a bundle of classes andSignalRUtil
class offers some common help methods.