
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
locust-node
Advanced tools
node-locust
is a load generator for locust written in JavaScript
# Start locust master
locust --master \
--master-bind-port 5557 \
--host <test-server> \
--locustfile ./locust-node/dummy.py
# Start node client
node-locust --locustfile ./examples/basic.js \
--master-host 127.0.0.1
--master-port 5557
const { Locust, TaskSet, HTTPClient } = require('node-locust');
class UserTasks extends TaskSet {
constructor() {
super();
this.http = new HTTPClient({
baseURL: <test-server>,
timeout: 2000
}, this.recordSuccess.bind(this),
this.recordFailure.bind(this));
this.tasks = [{
task: () => this.getUserInfo(),
weight: 2
}, {
task: () => this.updateUserInfo(),
weight: 1
}];
}
async getUserInfo() {
await this.http.request({
method: 'GET',
url: '/users/1'
});
}
async updateUserInfo() {
await this.http.request({
method: 'PUT',
url: '/users/1',
body: {
name: 'user-name'
}
});
}
}
class MyLocust extends Locust {
constructor() {
super();
this.taskSet = new UserTasks();
}
}
module.exports = { MyLocust };
Open source licensed under the MIT license (see LICENSE file for details).
FAQs
## Links
We found that locust-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.