public class CpuProfile extends Object
| Modifier and Type | Field and Description |
|---|---|
long |
m_count |
Duration |
m_duration |
long |
m_missed |
| Constructor and Description |
|---|
CpuProfile(Map<List<StackTraceElement>,Long> counts,
Duration duration,
long count,
long missed) |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
isRunnable(StackTraceElement elem)
When looking for RUNNABLEs, the JVM's notion of runnable differs from the
from kernel's definition and for some well known cases, we can filter out
threads that are actually asleep.
|
static String |
mainClassName()
Get the main class name for the currently running application.
|
CpuProfile |
record(Duration howlong,
int frequency) |
static CpuProfile |
record(Duration howlong,
int frequency,
Thread.State state)
Profile CPU usage of threads in `state` for `howlong`, sampling stacks at
`frequency` Hz.
|
static Future<CpuProfile> |
recordInThread(Duration howlong,
int frequency) |
static Future<CpuProfile> |
recordInThread(Duration howlong,
int frequency,
Thread.State state)
Call `record` in a thread with the given parameters, returning a `Future`
representing the completion of the profile.
|
void |
writeGoogleProfile(OutputStream out)
Write a Google pprof-compatible profile to `out`.
|
public final Duration m_duration
public final long m_count
public final long m_missed
public CpuProfile(Map<List<StackTraceElement>,Long> counts, Duration duration, long count, long missed)
public void writeGoogleProfile(OutputStream out) throws IOException
out - And OutputStream to which the pprof output will be writtenIOException - if any operation on the OutputStream failsprotected static boolean isRunnable(StackTraceElement elem)
elem - StackTraceElement to checkpublic static CpuProfile record(Duration howlong, int frequency, Thread.State state)
howlong - Duration of profilefrequency - polling intervalstate - Thread.State to match againstpublic CpuProfile record(Duration howlong, int frequency)
public static Future<CpuProfile> recordInThread(Duration howlong, int frequency, Thread.State state)
howlong - Duration of profilefrequency - polling intervalstate - Thread.State to match againstpublic static Future<CpuProfile> recordInThread(Duration howlong, int frequency)
public static String mainClassName()
Copyright © 2014–2019 Philip Helger. All rights reserved.