Class StartupTimer


  • public final class StartupTimer
    extends java.lang.Object
    A utility class intended to be used to monitor the startup behavior of a single process.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finished()
      Notifies this StartupTimer that the startup process was finished.
      static StartupTimer getInstance()  
      void start​(java.lang.String id, java.lang.String description)
      Notifies this StartupTimer that a new action in the startup process has begun.
      void stop​(java.lang.String id)
      Notifies this StartupTimer that the action identified by the id was finished.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static StartupTimer getInstance()
        Returns:
        singleton instance
      • start

        public void start​(java.lang.String id,
                          java.lang.String description)
        Notifies this StartupTimer that a new action in the startup process has begun.
        Parameters:
        id - id of the action. Must be used when stop(String) is called
        description - a human-readable description of the action that has begun
      • stop

        public void stop​(java.lang.String id)
        Notifies this StartupTimer that the action identified by the id was finished.
        Parameters:
        id - id of the action as used in start(String, String)
      • finished

        public void finished()
        Notifies this StartupTimer that the startup process was finished. If info-logging is enabled, the recorded times will be logged. Additionally, a new StartupTimerMBean will be registered. All actions, that were not yet stopped by calling stop(String), will be stopped. After this method was called, further calls to start(String, String) or stop(String) will have no effect.