Class Profiler
java.lang.Object
org.jpos.util.Profiler
- All Implemented Interfaces:
Loggeable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA single timed checkpoint entry recorded by the Profiler. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConversion factor from nanoseconds to milliseconds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckPoint(String detail) mark checkpointvoiddump(PrintStream p, String indent) Dumps profiler results to the given print stream.longReturns the total elapsed time since the last reset.longReturns total elapsed time in milliseconds since the last reset.Returns the profiler entry for the given event name.Returns all profiler events collected since the last reset.longReturns the partial elapsed time since the last checkpoint.longReturns partial elapsed time in milliseconds since the last checkpoint.voidreenable()Removes the "end" checkpoint so profiling can continue.voidreset()reset timersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Field Details
-
TO_MILLIS
-
-
Constructor Details
-
Profiler
public Profiler()Default constructor.
-
-
Method Details
-
reset
reset timers -
checkPoint
-
getElapsed
Returns the total elapsed time since the last reset.- Returns:
- total elapsed time since last reset
-
getElapsedInMillis
Returns total elapsed time in milliseconds since the last reset.- Returns:
- elapsed time in milliseconds
-
getPartial
Returns the partial elapsed time since the last checkpoint.- Returns:
- partial elapsed time since last reset
-
getPartialInMillis
Returns partial elapsed time in milliseconds since the last checkpoint.- Returns:
- partial elapsed time in milliseconds
-
dump
Dumps profiler results to the given print stream. -
getEvents
Returns all profiler events collected since the last reset.- Returns:
- ordered map of event name to Entry
-
getEntry
Returns the profiler entry for the given event name.- Parameters:
eventName- the event name- Returns:
- the corresponding Entry, or
nullif not found
-
reenable
Removes the "end" checkpoint so profiling can continue.
-