Class ProfilerConfiguration

java.lang.Object
com.atlassian.util.profiling.ProfilerConfiguration

@Internal public class ProfilerConfiguration extends Object
Configuration that applies to ProfilerStrategy
Since:
3.0
  • Constructor Details

    • ProfilerConfiguration

      public ProfilerConfiguration()
  • Method Details

    • enableForThread

      @Nonnull public Ticker enableForThread()
      Returns:
      a ticker that can be closed to end the temporary enabling of profiling on the current thread
    • getMaxFramesPerTrace

      public int getMaxFramesPerTrace()
      Returns:
      the maximum number of frames to include in a profiling trace
    • getMaxFrameNameLength

      public int getMaxFrameNameLength()
      Returns:
      the maximum number of characters in a profiling frame name. Longer names will be truncated.
    • getMinFrameTime

      public long getMinFrameTime(@Nonnull TimeUnit timeUnit)
      Parameters:
      timeUnit - the requested time unit
      Returns:
      the minimum time a frame should take to be included in a profiling trace. Frames that take less than this amount of time will be suppressed from the trace.
    • getMinTraceTime

      public long getMinTraceTime(@Nonnull TimeUnit timeUnit)
      Parameters:
      timeUnit - the requested time unit
      Returns:
      the minimum time a profiling trace should take. Traces that take less than this amount of time will be pruned from profiling output.
    • isEnabled

      public boolean isEnabled()
      Returns:
      whether profiling is enabled
    • isMemoryProfilingEnabled

      public boolean isMemoryProfilingEnabled()
      Returns:
      whether profiling should include memory usage
    • setEnabled

      public void setEnabled(boolean value)
      Parameters:
      value - whether profiling should be enabled
    • setMaxFramesPerTrace

      public void setMaxFramesPerTrace(int value)
      Parameters:
      value - the maximum number of frames to include in a profiling trace
    • setMaxFrameNameLength

      public void setMaxFrameNameLength(int value)
      Parameters:
      value - the maximum number of characters in a profiling frame name. Longer names will be truncated.
    • setMemoryProfilingEnabled

      public void setMemoryProfilingEnabled(boolean value)
      Parameters:
      value - whether profiling should include memory usage
    • setMinFrameTime

      public void setMinFrameTime(long value, @Nonnull TimeUnit timeUnit)
      Parameters:
      value - the minimum time a profiling trace should take. Traces that take less than this amount of time will be pruned from profiling output.
      timeUnit - the time unit of value
    • setMinTraceTime

      public void setMinTraceTime(long value, @Nonnull TimeUnit timeUnit)
      Parameters:
      value - the minimum time a profiling trace should take. Traces that take less than this amount of time will be pruned from profiling output.
      timeUnit - the time unit of value