makiwara
Install
npm install -g makiwara
Usage
const { attack } = require('makiwara');
attack('http://example.org', [1, 5, 10], 'sequence')
.then((result) => {
console.log(result);
})
.catch((err) => {
console.log(err);
});
CLI
makiwara --help
Usage: cli [options]
Example:
makiwara -u http://localhost:3000 -t 10 -s sequence
Options:
-V, --version output the version number
-u, --url <url> Define URL to attack. Ex. http://example.org/
-t, --timelimit [numbers] Define list of time thresholds (in seconds). Ex. 10,100,1000
-s, --strategy <concurrent|sequence> Define strategy for making requests
-h, --help output usage information
Example
makiwara -u https://example.org -t 1,5 -s sequence
Result:
╔════════════════════════╤════════════════════════════════╗
║ HTTP Status Code │ Requests quantity ║
╟────────────────────────┼────────────────────────────────╢
║ 200 OK │ 3 ║
╚════════════════════════╧════════════════════════════════╝
╔════════════════════════╤════════════════════════════════╗
║ Type │ Sequence ║
╟────────────────────────┼────────────────────────────────╢
║ Effective Duration │ 1.456 seconds ║
╟────────────────────────┼────────────────────────────────╢
║ Times │ 3 ║
╚════════════════════════╧════════════════════════════════╝
----------------------------------------------------
╔════════════════════════╤════════════════════════════════╗
║ HTTP Status Code │ Requests quantity ║
╟────────────────────────┼────────────────────────────────╢
║ 200 OK │ 10 ║
╚════════════════════════╧════════════════════════════════╝
╔════════════════════════╤════════════════════════════════╗
║ Type │ Sequence ║
╟────────────────────────┼────────────────────────────────╢
║ Effective Duration │ 5.399 seconds ║
╟────────────────────────┼────────────────────────────────╢
║ Times │ 10 ║
╚════════════════════════╧════════════════════════════════╝
Unit tests
npm test
Code coverage
npm run coverage
License
The MIT License @ 2017-2019