Class ShadowTrace

    • Constructor Detail

      • ShadowTrace

        public ShadowTrace()
    • Method Detail

      • beginSection

        protected static void beginSection​(String sectionName)
        Starts a new trace section with given name.
      • endSection

        protected static void endSection()
        Ends the most recent active trace section.
      • beginAsyncSection

        protected static void beginAsyncSection​(String sectionName,
                                                int cookie)
        Starts a new async trace section with given name.
      • endAsyncSection

        protected static void endAsyncSection​(String sectionName,
                                              int cookie)
        Ends async trace trace section.
      • setAppTracingAllowed

        protected static void setAppTracingAllowed​(boolean appTracingAllowed)
      • isEnabled

        protected static boolean isEnabled()
        Returns whether systrace is enabled.
      • setEnabled

        public static void setEnabled​(boolean enabled)
        Sets the systrace to enabled or disabled.
      • getCurrentSections

        public static Deque<String> getCurrentSections()
        Returns a stack of the currently active trace sections for the current thread.
      • getPreviousSections

        public static Queue<String> getPreviousSections()
        Returns a queue of all the previously active trace sections for the current thread.
      • getCurrentAsyncSections

        public static<ShadowTrace.AsyncTraceSection> getCurrentAsyncSections()
        Returns a set of all the current active async trace sections.
      • getPreviousAsyncSections

        public static<ShadowTrace.AsyncTraceSection> getPreviousAsyncSections()
        Returns a set of all the previously active async trace sections.
      • getCounters

        public static<ShadowTrace.Counter> getCounters()
        Returns an ordered list of previous counters.
      • doNotUseSetCrashOnIncorrectUsage

        public static void doNotUseSetCrashOnIncorrectUsage​(boolean crashOnIncorrectUsage)
        Do not use this method unless absolutely necessary. Prefer fixing the tests instead.

        Sets whether to crash on incorrect usage (e.g., calling endSection() before beginSection(java.lang.String). Default value - true.

      • reset

        public static void reset()
        Resets internal lists of active trace sections.