Class BurstProfiler

java.lang.Object
redempt.redlib.dev.profiler.Profiler
redempt.redlib.dev.profiler.BurstProfiler

public class BurstProfiler extends Profiler
A profiler best used in bursts. Uses a lot of memory to profile even short periods of time, but allows you to select certain timeframes to inspect
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new BurstProfiler with a default size of 10,000 (10 seconds)
    BurstProfiler(int size)
    Create a new BurstProfiler with an initial size, being the number of milliseconds it will be able to record
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    end()
     
    Gets a summary of the last X milliseconds of profiling, with X being the size this BurstProfiler was initialized with
    getSummary(long after)
    Gets a summary of the profiling after the specified time.
    void
    Start this profiler.

    Methods inherited from class redempt.redlib.dev.profiler.Profiler

    stop, stopAll

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BurstProfiler

      public BurstProfiler(int size)
      Create a new BurstProfiler with an initial size, being the number of milliseconds it will be able to record
      Parameters:
      size - The size of the sample queue to create, 1ms = 1 element
    • BurstProfiler

      public BurstProfiler()
      Create a new BurstProfiler with a default size of 10,000 (10 seconds)
  • Method Details

    • start

      public void start()
      Start this profiler. Must be run from the thread you intend to profile.
      Specified by:
      start in class Profiler
    • end

      protected void end()
      Specified by:
      end in class Profiler
    • getSummary

      public SampleSummary getSummary()
      Gets a summary of the last X milliseconds of profiling, with X being the size this BurstProfiler was initialized with
      Specified by:
      getSummary in class Profiler
      Returns:
      The summary
    • getSummary

      public SampleSummary getSummary(long after)
      Gets a summary of the profiling after the specified time. Cannot go back further than X milliseconds, with X being the size this BrustProfiler was initialized with
      Parameters:
      after - The timestamp after which summary data should be included
      Returns:
      The summary