Package com.bw.jtools.profiling
Class MethodProfilingInformation
- java.lang.Object
-
- com.bw.jtools.profiling.ProfilingInformation
-
- com.bw.jtools.profiling.IdentifiableProfilingInformation
-
- com.bw.jtools.profiling.MethodProfilingInformation
-
public final class MethodProfilingInformation extends IdentifiableProfilingInformation
Holds profiling information about a method or other code-unit during run-time.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.Integer,CalleeProfilingInformation>calleesCallees from this method.
Methods that are profiled during a call of this method are collected here.
Remind that only profiled methods are collected.ClassProfilingInformationclazzThe class/module of this method/code-unit.intexceptionsNumber of exceptions of this method.java.lang.StringnameThe method/code unit name.-
Fields inherited from class com.bw.jtools.profiling.IdentifiableProfilingInformation
ID
-
Fields inherited from class com.bw.jtools.profiling.ProfilingInformation
calls, maxMeasurement, minMeasurement, recursiveCalls, sum
-
-
Constructor Summary
Constructors Constructor Description MethodProfilingInformation(ClassProfilingInformation clazz, java.lang.String name)C'tor to create a new Method-Information instance.
-
Method Summary
Modifier and Type Method Description voidclear()Clear profiling information.voidendCall(MeasurementValue usedValue, boolean notRecursive)Ends a call of this method.
The method is popped from thread stack and the used time is added the method- and callee-information.CalleeProfilingInformationgetCalleeInformation(MethodProfilingInformation mi)Get the callee instance for the given method.
If not callee instance exists a new one is created and added.booleanstartCall()Starts a call of this method.
The method is pushed on the thread-stack.-
Methods inherited from class com.bw.jtools.profiling.ProfilingInformation
addCall
-
-
-
-
Field Detail
-
name
public final java.lang.String name
The method/code unit name.
-
clazz
public final ClassProfilingInformation clazz
The class/module of this method/code-unit.
-
exceptions
public int exceptions
Number of exceptions of this method.
-
callees
public final java.util.Map<java.lang.Integer,CalleeProfilingInformation> callees
Callees from this method.
Methods that are profiled during a call of this method are collected here.
Remind that only profiled methods are collected. Relation is not transitive.
-
-
Constructor Detail
-
MethodProfilingInformation
public MethodProfilingInformation(ClassProfilingInformation clazz, java.lang.String name)
C'tor to create a new Method-Information instance.- Parameters:
clazz- The class information the method belongs to.name- The name of the method.
-
-
Method Detail
-
getCalleeInformation
public CalleeProfilingInformation getCalleeInformation(MethodProfilingInformation mi)
Get the callee instance for the given method.
If not callee instance exists a new one is created and added.- Parameters:
mi- The method for which the callee-information should be returned.- Returns:
- The callee information, never null.
-
startCall
public boolean startCall()
Starts a call of this method.
The method is pushed on the thread-stack.- Returns:
- true if call was not recursive.
-
endCall
public void endCall(MeasurementValue usedValue, boolean notRecursive)
Ends a call of this method.
The method is popped from thread stack and the used time is added the method- and callee-information.- Parameters:
usedValue- The used measurement value.notRecursive- True if this call was not recursive.
-
clear
public void clear()
Description copied from class:ProfilingInformationClear profiling information.- Overrides:
clearin classProfilingInformation
-
-