Package redempt.redlib.dev.profiler
Class BurstProfiler
java.lang.Object
redempt.redlib.dev.profiler.Profiler
redempt.redlib.dev.profiler.BurstProfiler
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
ConstructorDescriptionCreate 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 TypeMethodDescriptionprotected void
end()
Gets a summary of the last X milliseconds of profiling, with X being the size this BurstProfiler was initialized withgetSummary
(long after) Gets a summary of the profiling after the specified time.void
start()
Start this profiler.
-
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. -
end
protected void end() -
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 classProfiler
- Returns:
- The summary
-
getSummary
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
-