Class FunctionCallRecorder


  • public class FunctionCallRecorder
    extends java.lang.Object
    This class is responsible for recording the call stack of a function call. Usually, this should be written following OO principles of encapsulation. But this class bytecode is injected on the actual code, and having stuff private seems to cause some issues. You will see some questionable visibility choices here.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void enterConstructor​(java.lang.reflect.Constructor<?> constructor)  
      static void enterFunction​(java.lang.reflect.Method method)  
      static void exit()  
      static java.lang.String getClassNameFor​(java.lang.reflect.Constructor<?> constructor)  
      static java.lang.String getClassNameFor​(java.lang.reflect.Method method)  
      static java.util.Optional<java.lang.String> getFinalCallStack()  
      static java.util.Optional<java.lang.String> getOldCallStack()  
      static void onEnter​(java.lang.String threadName, java.lang.String name, java.lang.String className, java.lang.String method, long entryTime)  
      static void onEnter​(java.lang.String threadName, java.lang.String name, java.lang.String className, java.lang.String method, long entryTime, java.lang.String[][] arguments)  
      static void onLeave​(java.lang.String threadName, long exitTime)  
      static void onLeave​(java.lang.String threadName, long exitTime, java.lang.String[] returnValue)  
      static void setShouldCaptureStacktrace​(boolean captureStacktrace)  
      static void setStartTrigger​(java.lang.String startTriggerFunctionNam)  
      static void setStopTrigger​(java.lang.String stopTriggerFunctionNam)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • stackPerThread

        public static final java.util.Map<java.lang.String,​Span> stackPerThread
      • shouldPrintQualified

        public static boolean shouldPrintQualified
      • shouldCaptureStacktrace

        public static boolean shouldCaptureStacktrace
      • isRecording

        public static boolean isRecording
      • startTrigger

        public static java.lang.String startTrigger
      • stopTrigger

        public static java.lang.String stopTrigger
    • Constructor Detail

      • FunctionCallRecorder

        public FunctionCallRecorder()
    • Method Detail

      • enterFunction

        public static void enterFunction​(java.lang.reflect.Method method)
      • enterConstructor

        public static void enterConstructor​(java.lang.reflect.Constructor<?> constructor)
      • exit

        public static void exit()
      • setStartTrigger

        public static void setStartTrigger​(java.lang.String startTriggerFunctionNam)
      • setShouldCaptureStacktrace

        public static void setShouldCaptureStacktrace​(boolean captureStacktrace)
      • setStopTrigger

        public static void setStopTrigger​(java.lang.String stopTriggerFunctionNam)
      • getClassNameFor

        public static java.lang.String getClassNameFor​(java.lang.reflect.Method method)
      • getClassNameFor

        public static java.lang.String getClassNameFor​(java.lang.reflect.Constructor<?> constructor)
      • onEnter

        public static void onEnter​(java.lang.String threadName,
                                   java.lang.String name,
                                   java.lang.String className,
                                   java.lang.String method,
                                   long entryTime)
      • onEnter

        public static void onEnter​(java.lang.String threadName,
                                   java.lang.String name,
                                   java.lang.String className,
                                   java.lang.String method,
                                   long entryTime,
                                   java.lang.String[][] arguments)
      • onLeave

        public static void onLeave​(java.lang.String threadName,
                                   long exitTime)
      • onLeave

        public static void onLeave​(java.lang.String threadName,
                                   long exitTime,
                                   java.lang.String[] returnValue)
      • getOldCallStack

        public static java.util.Optional<java.lang.String> getOldCallStack()
      • getFinalCallStack

        public static java.util.Optional<java.lang.String> getFinalCallStack()