Top Description Fields Constructors Methods
org.jruby.runtime.profile.builtin

public Class ProfileData

extends Object
implements ProfileCollection
Class Inheritance
All Implemented Interfaces
org.jruby.runtime.profile.ProfileCollection
Imports
org.jruby.runtime.ThreadContext, org.jruby.runtime.profile.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
org.jruby.internal.runtime.methods.ProfilingDynamicMethod

Field Summary

Modifier and TypeField and Description
private Invocation
private int[]
private final ProfiledMethods
private final ThreadContext
private Invocation

Constructor Summary

AccessConstructor and Description
public
ProfileData(ThreadContext context, ProfiledMethods profiledMethods)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clear the gathered profiling (invocation) data.

public Invocation

Returns:

the top invocation
computeResults
()

Compute the profiling results from gathered data.

protected void
decRecursionFor(int serial)

private void
public Invocation

Returns:

the currentInvocation
getCurrentInvocation
()

private ProfiledMethod
getProfiledMethod(final long serial)

public ThreadContext

Returns:

the threadContext
getThreadContext
()

public Invocation

Returns:

the topInvocation
getTopInvocation
()

protected int
incRecursionFor(int serial)

public String
methodName(final int serial)

public void
profileEnter(final long
the serial number of the next method to profile
calledMethod
)

Implements org.jruby.runtime.profile.ProfileCollection.profileEnter.

Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.

public void
profileExit(final long
the serial number of the next method to profile
callingMethod
,
final long
the nano timestamp at which the given callingMethod was entered
startTime
)

Implements org.jruby.runtime.profile.ProfileCollection.profileExit.

Fall back to previously profiled method after current method has returned.

private static Invocation
private void
private void
public long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentInvocationback to summary
private Invocation currentInvocation
methodRecursionback to summary
private int[] methodRecursion
profiledMethodsback to summary
private final ProfiledMethods profiledMethods
threadContextback to summary
private final ThreadContext threadContext
topInvocationback to summary
private Invocation topInvocation

Constructor Detail

ProfileDataback to summary
public ProfileData(ThreadContext context, ProfiledMethods profiledMethods)

Method Detail

clearback to summary
public void clear()

Clear the gathered profiling (invocation) data.

computeResultsback to summary
public Invocation computeResults()

Compute the profiling results from gathered data.

Returns:Invocation

the top invocation

decRecursionForback to summary
protected void decRecursionFor(int serial)
ensureRecursionSizeback to summary
private void ensureRecursionSize(int index)
getCurrentInvocationback to summary
public Invocation getCurrentInvocation()
Returns:Invocation

the currentInvocation

getProfiledMethodback to summary
private ProfiledMethod getProfiledMethod(final long serial)
getThreadContextback to summary
public ThreadContext getThreadContext()
Returns:ThreadContext

the threadContext

getTopInvocationback to summary
public Invocation getTopInvocation()
Returns:Invocation

the topInvocation

incRecursionForback to summary
protected int incRecursionFor(int serial)
methodNameback to summary
public String methodName(final int serial)
profileEnterback to summary
public void profileEnter(final long calledMethod)

Implements org.jruby.runtime.profile.ProfileCollection.profileEnter.

Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.

Parameters
calledMethod:long

the serial number of the next method to profile

Annotations
@Override
profileExitback to summary
public void profileExit(final long callingMethod, final long startTime)

Implements org.jruby.runtime.profile.ProfileCollection.profileExit.

Fall back to previously profiled method after current method has returned.

Parameters
callingMethod:long

the serial number of the next method to profile

startTime:long

Doc from org.jruby.runtime.profile.ProfileCollection.profileExit.

the nano timestamp at which the given callingMethod was entered

Annotations
@Override
setDurationback to summary
private static Invocation setDuration(Invocation inv)
setRecursiveDepthsback to summary
private void setRecursiveDepths()
setRecursiveDepths1back to summary
private void setRecursiveDepths1(Invocation inv)
totalTimeback to summary
public long totalTime()