Class ProfileData
java.lang.Object
org.jruby.runtime.profile.builtin.ProfileData
- All Implemented Interfaces:
ProfileCollection
Encapsulates the logic of recording and reporting profiled timings of
method invocations. This keeps track of aggregate values for callers and
callees of each method.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Invocationprivate int[]private final ProfiledMethodsprivate final ThreadContextprivate Invocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the gathered profiling (invocation) data.Compute the profiling results from gathered data.protected voiddecRecursionFor(int serial) private voidensureRecursionSize(int index) private ProfiledMethodgetProfiledMethod(long serial) protected intincRecursionFor(int serial) (package private) StringmethodName(int serial) voidprofileEnter(long calledMethod) Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.voidprofileExit(long callingMethod, long startTime) Fall back to previously profiled method after current method has returned.private static InvocationsetDuration(Invocation inv) private voidprivate voidlong
-
Field Details
-
currentInvocation
-
topInvocation
-
methodRecursion
private int[] methodRecursion -
threadContext
-
profiledMethods
-
-
Constructor Details
-
ProfileData
-
-
Method Details
-
getProfiledMethod
-
profileEnter
public void profileEnter(long calledMethod) Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.- Specified by:
profileEnterin interfaceProfileCollection- Parameters:
calledMethod- the serial number of the next method to profile
-
profileExit
public void profileExit(long callingMethod, long startTime) Fall back to previously profiled method after current method has returned.- Specified by:
profileExitin interfaceProfileCollection- Parameters:
callingMethod- the serial number of the next method to profilestartTime- the nano timestamp at which the given callingMethod was entered
-
clear
public void clear()Clear the gathered profiling (invocation) data. -
totalTime
public long totalTime() -
getTopInvocation
- Returns:
- the topInvocation
-
getCurrentInvocation
- Returns:
- the currentInvocation
-
getThreadContext
- Returns:
- the threadContext
-
computeResults
Compute the profiling results from gathered data.- Returns:
- the top invocation
-
setDuration
-
decRecursionFor
protected void decRecursionFor(int serial) -
incRecursionFor
protected int incRecursionFor(int serial) -
ensureRecursionSize
private void ensureRecursionSize(int index) -
setRecursiveDepths
private void setRecursiveDepths() -
setRecursiveDepths1
-
methodName
-