Giter Site home page Giter Site logo

jaredgorski / nodehog Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 0.0 697 KB

๐Ÿ— A simple cpu hog utility.

Home Page: https://www.npmjs.com/package/nodehog

License: MIT License

JavaScript 100.00%
kubernetes autoscaling stress cpu-hog horizontal-pod-autoscaler stress-testing

nodehog's Introduction

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 ๐Ÿ˜ƒ

nodehog's People

Contributors

jaredgorski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.