Giter VIP home page Giter VIP logo

otj-pausedetector's Introduction

OpenTable JVM Pause Alarm

Build Status

Provide basic notification if the JVM is unable to keep its threads running for extended periods of time e.g. because of GC, lack of CPU time.

Basic Usage

The alarm has very basic configuration available:

  • Check interval -- how long to wait between each time check
  • Alarm time -- minimum pause to report
  • Action on pause -- user-supplied callback when a pause alarms
  • Clock -- replace the system clock for testing purposes
public class MyCoolApp {
  public static void main(String[] args) {
    try (new JvmPauseAlarm(100, 400).start()) {
      runMyCoolApp();
    }
  }
}

This will set up the pause alarm to check every 100ms for pauses of at least 400ms.

Example output:

[jvm-pause-alarm] INFO com.opentable.pausedetector.JvmPauseAlarm - Watching JVM for GC pausing.  Checking every 10ms for pauses of at least 400ms.
[jvm-pause-alarm] WARN com.opentable.pausedetector.JvmPauseAlarm - Detected pause of 1000ms!

For Spring, you can import JvmPauseAlarmConfiguration and starting / stopping the alarm is taken care of for you. You then use the following properties to configure it:

ot.jvm-pause.enabled=true
ot.jvm-pause.check-time=PT0.05s
ot.jvm-pause.pause-time=PT0.2s

Copyright (C) 2016 OpenTable, Inc.

otj-pausedetector's People

Contributors

adamzr avatar mikebell90 avatar rushalias avatar stevenschlansker avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.