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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the gathered profiling (invocation) data.Compute the profiling results from gathered data.protected void
decRecursionFor
(int serial) protected int
incRecursionFor
(int serial) methodName
(int serial) void
profileEnter
(long calledMethod) Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.void
profileExit
(long callingMethod, long startTime) Fall back to previously profiled method after current method has returned.long
-
Constructor Details
-
ProfileData
-
-
Method Details
-
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:
profileEnter
in 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:
profileExit
in 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
-
decRecursionFor
protected void decRecursionFor(int serial) -
incRecursionFor
protected int incRecursionFor(int serial) -
methodName
-