Class Profiler

java.lang.Object
org.jpos.util.Profiler
All Implemented Interfaces:
Loggeable

public class Profiler extends Object implements Loggeable
Simple Profiler
  • Field Details

  • Constructor Details

    • Profiler

      public Profiler()
      Default constructor.
  • Method Details

    • reset

      public void reset()
      reset timers
    • checkPoint

      public void checkPoint(String detail)
      mark checkpoint
      Parameters:
      detail - checkpoint information
    • getElapsed

      public long getElapsed()
      Returns the total elapsed time since the last reset.
      Returns:
      total elapsed time since last reset
    • getElapsedInMillis

      public long getElapsedInMillis()
      Returns total elapsed time in milliseconds since the last reset.
      Returns:
      elapsed time in milliseconds
    • getPartial

      public long getPartial()
      Returns the partial elapsed time since the last checkpoint.
      Returns:
      partial elapsed time since last reset
    • getPartialInMillis

      public long getPartialInMillis()
      Returns partial elapsed time in milliseconds since the last checkpoint.
      Returns:
      partial elapsed time in milliseconds
    • dump

      public void dump(PrintStream p, String indent)
      Dumps profiler results to the given print stream.
      Specified by:
      dump in interface Loggeable
      Parameters:
      p - the output stream
      indent - indent prefix
    • getEvents

      Returns all profiler events collected since the last reset.
      Returns:
      ordered map of event name to Entry
    • getEntry

      public Profiler.Entry getEntry(String eventName)
      Returns the profiler entry for the given event name.
      Parameters:
      eventName - the event name
      Returns:
      the corresponding Entry, or null if not found
    • reenable

      public void reenable()
      Removes the "end" checkpoint so profiling can continue.