`etherpad-load-test-socket-io` is a client library providing the core logic for programmatically load testing an Etherpad instance via its Socket.IO API. It simulates various user activities, such as "lurkers" (viewers) and "active authors" (editors), to gauge the performance and scalability of an Etherpad server. While this package provides the underlying client functionality, it is typically consumed by higher-level command-line tools, such as `etherpad-load-test`, which offer a more user-friendly interface for executing load tests. The current stable version is 1.0.3, with a Node.js engine requirement of `>=18.0.0`. Its release cadence aligns with the development of the `etherpad-load-test` CLI and the broader Etherpad project, focusing on stability and compatibility with Etherpad Lite. Its key differentiator is its direct, low-level interaction with Etherpad's Socket.IO protocol, enabling deep customization of load testing scenarios.
npm install etherpad-load-test-socket-ioVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to programmatically initialize and connect a single `etherpad-load-test-socket-io` client to a specific Etherpad pad, simulating a user for a set duration, and handling basic connection events.
Add `"loadTest": true` to your Etherpad Lite server's `settings.json` and restart the Etherpad instance.
Always set `"loadTest": false` in your Etherpad Lite `settings.json` and restart the server once load testing is complete.
If you intend to use a command-line interface, install `etherpad-load-test` globally (`npm install -g etherpad-load-test`). For programmatic use, import and instantiate the `Client` class from `etherpad-load-test-socket-io`.
Verify your Etherpad instance is running and accessible at the specified `etherpadUrl`. Double-check that `"loadTest": true` is set in `settings.json` and the Etherpad server has been restarted. Ensure no firewall is blocking the connection.
Install the package using `npm install etherpad-load-test-socket-io` or `yarn add etherpad-load-test-socket-io`. If using TypeScript or a bundler, ensure your configuration (e.g., `tsconfig.json`) supports ES module imports for Node.js modules, or use `const Client = require(...)` for CommonJS.
Ensure the `padId` is valid on your Etherpad instance. Review the Etherpad server logs for any errors related to Socket.IO connections or pad access. Verify compatibility between the client library version and your Etherpad Lite server version, especially regarding Socket.IO protocol changes.