Package de.gsi.dataset.utils
Class ProcessingProfiler
- java.lang.Object
-
- de.gsi.dataset.utils.ProcessingProfiler
-
public final class ProcessingProfiler extends java.lang.ObjectSmall utility class to measure ns-level processing delays- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleandebugStateboolean flag controlling whether diagnostics time-marks are taken or the routine to be skippedprotected static booleanloggerOutputboolean flag controlling whether the statistics/time differences are output to the logger/console or notprotected static booleanverboseOutputboolean flag controlling whether the statistics/time differences are output to the logger/console or not
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>getCallingClassMethod(int... recursionDepth)protected static java.lang.StringgetCallingClassMethod(java.lang.String msg)static booleangetDebugState()static booleangetLoggerOutputState()static longgetTimeDiff(long lastStamp)static longgetTimeDiff(long lastStamp, java.lang.String msg)static longgetTimeStamp()Returns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds.static booleangetVerboseOutputState()static voidsetDebugState(boolean state)boolean flag controlling whether diagnostics time-marks are taken or the routine to be skippedstatic voidsetLoggerOutputState(boolean state)boolean flag controlling whether the statistics/time differences are output to the logger/console or notstatic voidsetVerboseOutputState(boolean state)boolean flag controlling whether the statistics/time differences are output to the logger/console or not
-
-
-
Field Detail
-
debugState
protected static boolean debugState
boolean flag controlling whether diagnostics time-marks are taken or the routine to be skipped
-
verboseOutput
protected static boolean verboseOutput
boolean flag controlling whether the statistics/time differences are output to the logger/console or not
-
loggerOutput
protected static boolean loggerOutput
boolean flag controlling whether the statistics/time differences are output to the logger/console or not
-
-
Method Detail
-
setDebugState
public static void setDebugState(boolean state)
boolean flag controlling whether diagnostics time-marks are taken or the routine to be skipped- Parameters:
state- true: enable
-
getDebugState
public static boolean getDebugState()
- Returns:
- boolean flag controlling whether diagnostics time-marks are taken or the routine to be skipped
-
setVerboseOutputState
public static void setVerboseOutputState(boolean state)
boolean flag controlling whether the statistics/time differences are output to the logger/console or not- Parameters:
state- true: enable
-
getVerboseOutputState
public static boolean getVerboseOutputState()
- Returns:
- boolean flag controlling whether the statistics/time differences are output to the logger/console or not
-
setLoggerOutputState
public static void setLoggerOutputState(boolean state)
boolean flag controlling whether the statistics/time differences are output to the logger/console or not- Parameters:
state- true: enable
-
getLoggerOutputState
public static boolean getLoggerOutputState()
- Returns:
- boolean flag controlling whether the statistics/time differences are output to the logger/console or not
-
getTimeStamp
public static long getTimeStamp()
Returns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds.This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary origin time.
the overhead of taking the time stamp is disabled via #debugProperty()
- Returns:
- nanoSecond resolution time stam
-
getTimeDiff
public static long getTimeDiff(long lastStamp)
- Parameters:
lastStamp- reference time stamp- Returns:
- actual delay
-
getCallingClassMethod
public static java.util.List<java.lang.String> getCallingClassMethod(int... recursionDepth)
- Parameters:
recursionDepth- 0 being the calling function- Returns:
- the 'class::function(line:xxx)' string
-
getCallingClassMethod
protected static java.lang.String getCallingClassMethod(java.lang.String msg)
-
getTimeDiff
public static long getTimeDiff(long lastStamp, java.lang.String msg)- Parameters:
lastStamp- reference time stampmsg- custom string message that should be printed alongside the time stamp- Returns:
- actual delay
-
-