Class StartupTimer

java.lang.Object
com.saperion.util.StartupTimer

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

    • getInstance

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

      public void start(String id, 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(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.