Class ProfileData

java.lang.Object
org.jruby.runtime.profile.builtin.ProfileData
All Implemented Interfaces:
ProfileCollection

public class ProfileData extends Object implements 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 Details

  • 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 interface ProfileCollection
      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 interface ProfileCollection
      Parameters:
      callingMethod - the serial number of the next method to profile
      startTime - 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

      public Invocation getTopInvocation()
      Returns:
      the topInvocation
    • getCurrentInvocation

      public Invocation getCurrentInvocation()
      Returns:
      the currentInvocation
    • getThreadContext

      public ThreadContext getThreadContext()
      Returns:
      the threadContext
    • computeResults

      public Invocation 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

      public String methodName(int serial)