Class ThreadTrace


  • public class ThreadTrace
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(jetbrains.buildServer.diagnostic.ThreadTrace.TraceListener traceListener)  
      void discardTrace()  
      void enableTraceRecording()
      Enables trace recording for the current thread
      static ThreadTrace getInstance()  
      java.lang.String getTraceNameForThread​(java.lang.String threadName)  
      void persistTrace​(java.lang.String comment, long persistThresholdMillis, java.lang.String traceName)
      Persists recorded trace on disk and stops recording.
      void persistTrace​(java.lang.String comment, java.lang.String traceName)
      Persists recorded trace on disk and stops recording.
      • Methods inherited from class java.lang.Object

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

      • getInstance

        @NotNull
        public static ThreadTrace getInstance()
      • enableTraceRecording

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

        public void persistTrace​(@NotNull
                                 java.lang.String comment,
                                 @NotNull
                                 java.lang.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
                                 java.lang.String comment,
                                 long persistThresholdMillis,
                                 @NotNull
                                 java.lang.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 java.lang.String getTraceNameForThread​(@NotNull
                                                      java.lang.String threadName)