public class PerformanceTestUtils
extends java.lang.Object
Constructor and Description |
---|
PerformanceTestUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
getProcessCpuAverage()
Not very fine-grained so not very useful; use
getProcessCpuTime(Duration) |
static long |
getProcessCpuTime() |
static double |
getProcessCpuTime(Duration period) |
static java.util.concurrent.Future<?> |
sampleProcessCpuTime(Duration period,
java.lang.String loggingContext)
Creates a background thread that will log.info the CPU fraction usage repeatedly, sampling at the given period.
|
static java.util.concurrent.Future<?> |
sampleProcessCpuTime(Duration period,
java.lang.String loggingContext,
java.util.List<java.lang.Double> cpuFractions) |
public static long getProcessCpuTime()
public static double getProcessCpuTime(Duration period)
public static double getProcessCpuAverage()
getProcessCpuTime(Duration)
public static java.util.concurrent.Future<?> sampleProcessCpuTime(Duration period, java.lang.String loggingContext)
future.cancel(true)
, otherwise it will keep
logging until the JVM exits.public static java.util.concurrent.Future<?> sampleProcessCpuTime(Duration period, java.lang.String loggingContext, java.util.List<java.lang.Double> cpuFractions)