Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaredgorski/nodehog
🐗 A simple cpu hog utility.
https://github.com/jaredgorski/nodehog
autoscaling cpu-hog horizontal-pod-autoscaler kubernetes stress stress-testing
Last synced: about 1 month ago
JSON representation
🐗 A simple cpu hog utility.
- Host: GitHub
- URL: https://github.com/jaredgorski/nodehog
- Owner: jaredgorski
- License: mit
- Created: 2019-05-14T23:06:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-26T01:48:42.000Z (almost 5 years ago)
- Last Synced: 2024-11-14T11:34:09.487Z (2 months ago)
- Topics: autoscaling, cpu-hog, horizontal-pod-autoscaler, kubernetes, stress, stress-testing
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/nodehog
- Size: 681 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NodeHog
A simple resource hog utility.![](https://raw.githubusercontent.com/jaredgorski/nodehog/master/.media/nodehog_example.png)
## Installation
#### Local use
```shell
npm i -g nodehog
```
#### Project use
```shell
npm i nodehog
```## Usage
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.### Parameters
- **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)_#### CLI
```console
$ nodehog cpu 30000 30000 3╔═════════════════════════════════════════════════/
║ nodehog cpu 30000 30000 3
╚═══════════════════════════════════════════════/
| | | | |
| | | | |
command | | | |
type | | |
lifespan(ms) | |
deathspan(ms) |
iterations
```
#### Programmatically
```js
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 😃