Class ThreadTrace


  • public class ThreadTrace
    extends Object
    • Method Detail

      • getInstance

        @NotNull
        public static ThreadTrace getInstance()
      • enableTraceRecording

        public void enableTraceRecording()
        Enables trace recording for the current thread
      • persistTrace

        public void persistTrace​(@NotNull
                                 String comment,
                                 @NotNull
                                 String traceName)
        Persists recorded trace on disk and stops recording. Persisting is only done if trace duration exceeds configured time, see ThreadTracePersistingConfig#getPersistThresholdMillis(), otherwise trace is discarded.
        Parameters:
        comment - comment to save to the trace file
        traceName - name of the trace (will be saved to the trace file name)
      • persistTrace

        public void persistTrace​(@NotNull
                                 String comment,
                                 long persistThresholdMillis,
                                 @NotNull
                                 String traceName)
        Persists recorded trace on disk and stops recording. Persisting is done only if trace duration exceeds specified duration threshold, otherwise trace is discarded.
        Parameters:
        comment - comment to save to the trace file
        traceName - name of the trace (will be saved to the trace file name)
        persistThresholdMillis - trace duration threshold
      • discardTrace

        public void discardTrace()
      • addListener

        public void addListener​(@NotNull
                                jetbrains.buildServer.diagnostic.ThreadTrace.TraceListener traceListener)
      • getTraceNameForThread

        @Nullable
        public String getTraceNameForThread​(@NotNull
                                            String threadName)