Package com.bw.jtools.profiling
Class ThreadProfilingInformation
- java.lang.Object
-
- com.bw.jtools.profiling.ThreadProfilingInformation
-
public final class ThreadProfilingInformation extends java.lang.ObjectHolds Thread Information during run-time.
-
-
Method Summary
Modifier and Type Method Description ClassProfilingInformationgetClassInformation(java.lang.Class<?> clazz)Gets the class information for a class.ClassProfilingInformationgetClassInformation(java.lang.String clazz)Gets the class information for a class.
Remind thatClassProfilingInformation.SIMPLE_NAMESis true the class name should be the simple name without package-prefix.MethodProfilingInformationgetCurrentMethod()Returns the current profiled method on stack.static ThreadProfilingInformationgetInstance()Gets the instance for the current thread.booleanisOnStack(MethodProfilingInformation mi)Checks if a method is on stack.voidpopMethod(MethodProfilingInformation mi)Pops the method from stack.
For robustness, all other methods until the specified one are also popped.booleanpushMethod(MethodProfilingInformation mi)Push a method on stack if not already in.
As recursion is not really possible to track with the current profiling concept, recursive calls are ignored.
-
-
-
Method Detail
-
getInstance
public static ThreadProfilingInformation getInstance()
Gets the instance for the current thread.- Returns:
- The instance.
-
getClassInformation
public ClassProfilingInformation getClassInformation(java.lang.Class<?> clazz)
Gets the class information for a class.- Parameters:
clazz- The class.- Returns:
- The class information, never null.
-
getClassInformation
public ClassProfilingInformation getClassInformation(java.lang.String clazz)
Gets the class information for a class.
Remind thatClassProfilingInformation.SIMPLE_NAMESis true the class name should be the simple name without package-prefix.- Parameters:
clazz- The name of the class.- Returns:
- The class information, never null.
-
getCurrentMethod
public MethodProfilingInformation getCurrentMethod()
Returns the current profiled method on stack.- Returns:
- The method, possibly null.
-
isOnStack
public boolean isOnStack(MethodProfilingInformation mi)
Checks if a method is on stack.- Parameters:
mi- The method.- Returns:
- True if on stack.
-
popMethod
public void popMethod(MethodProfilingInformation mi)
Pops the method from stack.
For robustness, all other methods until the specified one are also popped.- Parameters:
mi- The method.
-
pushMethod
public boolean pushMethod(MethodProfilingInformation mi)
Push a method on stack if not already in.
As recursion is not really possible to track with the current profiling concept, recursive calls are ignored.- Parameters:
mi- The Method.- Returns:
- true if method was not on stack.
-
-