public class PerformanceTestUtils extends 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 Future<?> |
sampleProcessCpuTime(Duration period,
String loggingContext)
Creates a background thread that will log.info the CPU fraction usage repeatedly, sampling at the given period.
|
static Future<?> |
sampleProcessCpuTime(Duration period,
String loggingContext,
List<Double> cpuFractions) |
public static long getProcessCpuTime()
public static double getProcessCpuTime(Duration period)
public static double getProcessCpuAverage()
getProcessCpuTime(Duration)public static Future<?> sampleProcessCpuTime(Duration period, String loggingContext)
future.cancel(true), otherwise it will keep
logging until the JVM exits.Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.