public class PerformanceProfileStore extends Object
BASE_DIRECTORY_PROPERTY
:
- PerformanceProfileStore.last holds the best performance run keyed by the name of the test
- PerformanceProfileStore.variance contains the variance for a test (keyed by test name) or, if not present, then the default variance
(eg 1.1 indicates a variance of lest than 10%)
- PerformanceProfileStore.args contains any arguments required by a test keyed by test name with value a comma separated string
(the configured values for arguments can be overridden by setting a system property called "testname.args" to the new value)
To disable regression checks set the boolean property FAIL_ON_PERF_REGRESSION_PROP
To reset performance data for a test set the boolean property RESET_NETRICS_PROP
Modifier and Type | Field and Description |
---|---|
static String |
BASE_DIRECTORY_PROPERTY |
static Float |
DEFAULT_VARIANCE |
static String |
FAIL_ON_PERF_REGRESSION_PROP |
static String |
PERFARGSFILENAME |
static String |
PERFDATAFILENAME |
static String |
PERFVARIANCEFILENAME |
static String |
PROPFILE_COMMENT |
static String |
RESET_NETRICS_PROP |
static boolean |
resetMetrics |
Constructor and Description |
---|
PerformanceProfileStore() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkPerformance(StringBuilder info,
String metricName,
float metricValue,
boolean largerIsBetter) |
static boolean |
checkPerformance(String metricName,
float metricValue) |
static boolean |
checkPerformance(String metricName,
float metricValue,
boolean largerIsBetter) |
static <T> T |
getArg(String metricName,
String[] args,
int index,
T defaultValue,
Class<T> argClass)
Convert a String to another type
|
static Map<String,Float> |
getMatchingMetrics(String pattern)
get metrics matching a particular pattern
|
static Float |
getMetric(String metricName) |
static String[] |
getTestArgs(String metricName)
Lookup any configured test arguments
PERFARGSFILENAME |
static float |
getVariance() |
static float |
getVariance(String metricName) |
static boolean |
isFailOnRegression() |
static boolean |
isResetMetrics() |
static <T> Measurement<T> |
regressionCheck(WorkerLifecycle lifecycle,
WorkerWorkload<T> workload,
String metricName,
boolean useConfigArgs,
long maxTestTime,
int warmUpCount,
int numberOfCalls,
int threadCount,
int batchSize)
Measure the performance of a workload.
|
static <T> Measurement<T> |
regressionCheck(WorkerWorkload<T> workload,
String metricName,
boolean useConfigArgs,
int warmUpCount,
int numberOfCalls,
int threadCount,
int batchSize)
Measure the performance of a workload.
|
static <T> Measurement<T> |
regressionCheck(WorkerWorkload<T> workload,
String metricName,
boolean useConfigArgs,
long maxTestTime,
int warmUpCount,
int numberOfCalls,
int threadCount,
int batchSize)
Measure the performance of a workload.
|
public static final String BASE_DIRECTORY_PROPERTY
public static final Float DEFAULT_VARIANCE
public static final String PERFDATAFILENAME
public static final String PERFVARIANCEFILENAME
public static final String PERFARGSFILENAME
public static final String PROPFILE_COMMENT
public static final String FAIL_ON_PERF_REGRESSION_PROP
public static final String RESET_NETRICS_PROP
public static final boolean resetMetrics
public static boolean isResetMetrics()
public static boolean isFailOnRegression()
public static float getVariance()
public static float getVariance(String metricName)
public static boolean checkPerformance(String metricName, float metricValue)
public static boolean checkPerformance(String metricName, float metricValue, boolean largerIsBetter)
public static boolean checkPerformance(StringBuilder info, String metricName, float metricValue, boolean largerIsBetter)
public static <T> Measurement<T> regressionCheck(WorkerWorkload<T> workload, String metricName, boolean useConfigArgs, int warmUpCount, int numberOfCalls, int threadCount, int batchSize)
Measurement
object contains the results of the measurement.T
- caller specific context dataworkload
- the actual workload being measuredmetricName
- the name of the test used as a key into performance data PERFDATAFILENAME
useConfigArgs
- if true read test arguments from a file (getTestArgs(String)
warmUpCount
- Number of iterations of the workload to run before starting the measurementnumberOfCalls
- Number of workload iterations (workload is called in batchSize batches until numberOfCalls is reached)threadCount
- Number of threads used to complete the workloadbatchSize
- The workload is responsible for running batchSize iterations on each callpublic static <T> Measurement<T> regressionCheck(WorkerWorkload<T> workload, String metricName, boolean useConfigArgs, long maxTestTime, int warmUpCount, int numberOfCalls, int threadCount, int batchSize)
Measurement
object contains the results of the measurement.T
- caller specific context dataworkload
- the actual workload being measuredmetricName
- the name of the test used as a key into performance data PERFDATAFILENAME
useConfigArgs
- if true read test arguments from a file (getTestArgs(String)
maxTestTime
- Abort the measurement if this time (in msecs) is exceeded TODOwarmUpCount
- Number of iterations of the workload to run before starting the measurementnumberOfCalls
- Number of workload iterations (workload is called in batchSize batches until numberOfCalls is reached)threadCount
- Number of threads used to complete the workloadbatchSize
- The workload is responsible for running batchSize iterations on each callpublic static <T> Measurement<T> regressionCheck(WorkerLifecycle lifecycle, WorkerWorkload<T> workload, String metricName, boolean useConfigArgs, long maxTestTime, int warmUpCount, int numberOfCalls, int threadCount, int batchSize)
Measurement
object contains the results of the measurement.T
- caller specific context datalifecycle
- lifecycle calls during the measurementworkload
- the actual workload being measuredmetricName
- the name of the test used as a key into performance data PERFDATAFILENAME
useConfigArgs
- if true read test arguments from a file (getTestArgs(String)
maxTestTime
- Abort the measurement if this time (in msecs) is exceeded TODOwarmUpCount
- Number of iterations of the workload to run before starting the measurementnumberOfCalls
- Number of workload iterations (workload is called in batchSize batches until numberOfCalls is reached)threadCount
- Number of threads used to complete the workloadbatchSize
- The workload is responsible for running batchSize iterations on each callpublic static <T> T getArg(String metricName, String[] args, int index, T defaultValue, Class<T> argClass)
T
- the type which args[index] should be converted tometricName
- the name of the test to use if there was a data format errorargs
- arguments returned from a prior call to getTestArgs(String)
index
- index into the args array to the value to be converteddefaultValue
- default value if the index is out of rangeargClass
- class type to convert the value to (which must have a constructor that takes a String value)public static String[] getTestArgs(String metricName)
PERFARGSFILENAME
metricName
- the name of the testCopyright © 2021 JBoss by Red Hat. All rights reserved.