A simple resource hog utility.
npm i -g nodehog
npm i nodehog
This program can be used to create scheduled stress tests on a given target. Use cases include testing program performance under max CPU or Memory load, testing recovery from max load, and testing virtual autoscaling features such as the Kubernetes horizontal pod autoscaler.
- Type: The type of resource to stress (memory | cpu)
- Lifespan: The length of the stress period in milliseconds
- Deathspan: The length of the relief period in milliseconds
- Iterations: The number of cycles to complete before NodeHog exits (1 cycle = 1 lifespan + 1 deathspan)
$ nodehog cpu 30000 30000 3
╔═════════════════════════════════════════════════/
║ nodehog cpu 30000 30000 3
╚═══════════════════════════════════════════════/
| | | | |
| | | | |
command | | | |
type | | |
lifespan(ms) | |
deathspan(ms) |
iterations
const NodeHog = require('nodehog');
new NodeHog('memory', 30000, 15000, 10).start();
If you find this useful, leave a star! If it can be improved in any way for your use case, fork it, send a PR, or just let me know 😃