Socket
Socket
Sign inDemoInstall

nodehog

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nodehog

A simple cpu hog utility.


Version published
Weekly downloads
108
increased by8%
Maintainers
1
Install size
725 kB
Created
Weekly downloads
 

Readme

Source

NodeHog

A simple resource hog utility.

Installation

Local use
npm i -g nodehog
Project use
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
$ nodehog cpu 30000 30000 3

╔═════════════════════════════════════════════════/
║  nodehog     cpu      30000     30000     3
╚═══════════════════════════════════════════════/
     |          |         |         |       |
     |          |         |         |       |
  command       |         |         |       |
               type       |         |       |
                     lifespan(ms)   |       |
                             deathspan(ms)  |
                                        iterations
Programmatically
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 😃

Keywords

FAQs

Last updated on 08 Oct 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc