CLI Tool for sending a lot of messages over mqtt for stress testing services
Install with npm
CLI:
$ npm i -g mqtt-stress
API:
$ npm i mqtt-stress
CLI:
$ mqtt-stress -b mqtt://localhost -t topic "message"
For more information run mqtt-stress --help
API:
var mqttStress = require('mqtt-stress');
var result = mqttStress.stress('mqtt://localhost', 'topic', 'message');
result.events.on('throughput', throughput => {
console.info(`Throughput: ${throughput}`);
});
result.events.on('error', err => {
console.error(`Error: ${err}`);
})
setTimeout(() => {
result.stop()
.then(() => {
console.info('Stopped successfully!');
})
.catch(err => {
console.error(`Error while stopping: ${err}`);
})
}, 1000);
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Joge
Copyright © 2019 Joge Licensed under the MIT license.