Giter Site home page Giter Site logo

chaos-professor's Introduction

Chaos Professor

Usage

Chaos Professor is a web application that creates some chaos in the JVM.

After cloning with git you can start the web application locally using Maven and Spring boot.

mvn spring-boot:run

The web application runs on port 8080 by default. Open your browser and point to the application (http://localhost:8080). The chaos professor web app exposes a REST API for calling some operations. Following operations are supported:

  • Heap: Creates Java heap memory usage by loading random byte data into memory.
    • size: size in mb specifies the target size to allocate (default = 5mb)
    • time: time in milliseconds to keep the allocated memory (default = 3000ms)
  • CPU: Creates CPU load by creating multiple threads that calculate Math.tan() values in endless loop.
    • threads: amount of threads to create (default = 10)
    • keepAlive: time to keep computing threads alive (default = 5000ms)

Examples how to use the REST API. Open your browser and hit following examples:

http://localhost:8080/chaos/heap
http://localhost:8080/chaos/heap?size=500&time=10000
http://localhost:8080/chaos/cpu
http://localhost:8080/chaos/cpu?threads=100&keepAlive=20000

Operation properties are optional so you can leave them out as you like.

Jolokia

The web application also exposes Jolokia services with a REST API. So you can access JVM related attributes in your browser:

http://localhost:8080/jolokia/read/java.lang:type=Memory/HeapMemoryUsage
http://localhost:8080/jolokia/read/java.lang:type=OperatingSystem/ProcessCpuLoad

First example reads the actual JVM memory usage. Second example reads the actual JVM CPU usage in %. The REST API returns JSON objects as response.

You can also execute JMX operations with Jolokia. For example you can call Java garbage collection.

http://localhost:8080/jolokia/exec/java.lang:type=Memory/gc

chaos-professor's People

Contributors

christophd avatar

Watchers

 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.