org.jruby.runtime.profile
Class ProfileData

java.lang.Object
  extended by org.jruby.runtime.profile.ProfileData
All Implemented Interfaces:
IProfileData

public class ProfileData
extends java.lang.Object
implements IProfileData

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 ProfilingDynamicMethod for the "hook" end of profiling.


Constructor Summary
ProfileData(ThreadContext tc)
           
 
Method Summary
 Invocation addDuration(Invocation inv)
           
 void clear()
           
 void decRecursionFor(int serial)
           
 Invocation getCurrentInvocation()
           
 Invocation getResults()
           
 ThreadContext getThreadContext()
           
 Invocation getTopInvocation()
           
 int incRecursionFor(int serial)
           
 int profileEnter(int calledMethod)
          Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.
 int profileExit(int callingMethod, long startTime)
          Fall back to previously profiled method after current method has returned.
 long totalTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileData

public ProfileData(ThreadContext tc)
Method Detail

profileEnter

public int profileEnter(int calledMethod)
Begin profiling a new method, aggregating the current time diff in the previous method's profile slot.

Specified by:
profileEnter in interface IProfileData
Parameters:
nextMethod - the serial number of the next method to profile
Returns:
the serial number of the previous method being profiled

profileExit

public int profileExit(int callingMethod,
                       long startTime)
Fall back to previously profiled method after current method has returned.

Specified by:
profileExit in interface IProfileData
Parameters:
nextMethod - the serial number of the next method to profile
Returns:
the serial number of the previous method being profiled

clear

public void clear()
Specified by:
clear in interface IProfileData

decRecursionFor

public void decRecursionFor(int serial)

incRecursionFor

public int incRecursionFor(int serial)

totalTime

public long totalTime()

getTopInvocation

public Invocation getTopInvocation()
Returns:
the topInvocation

getResults

public Invocation getResults()
Specified by:
getResults in interface IProfileData

addDuration

public Invocation addDuration(Invocation inv)

getCurrentInvocation

public Invocation getCurrentInvocation()
Returns:
the currentInvocation

getThreadContext

public ThreadContext getThreadContext()
Returns:
the threadContext


Copyright © 2002-2009 JRuby Team. All Rights Reserved.