Package io.narayana.perf
Class RegressionChecker
java.lang.Object
io.narayana.perf.RegressionChecker
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRegressionChecker(String perfArgsFileName, String perfHistoryFileName, String perfVarFileName) -
Method Summary
Modifier and TypeMethodDescription<T> TConvert a String to another typegetMatchingMetrics(String pattern) get metrics matching a particular patternString[]getTestArgs(String metricName) Lookup any configured test argumentsdoublegetVariance(String metricName) booleanIf isFailOnRegression is false then new metrics will not be persisted to the metrics storestatic booleanbooleanstatic BooleanreadBooleanProperty(String propName) voidsetFailOnRegression(boolean failOnRegression) voidsetResetMetrics(boolean resetMetrics)
-
Field Details
-
BASE_DIRECTORY_PROPERTY
- See Also:
-
RESET_NETRICS_PROP
- See Also:
-
FAIL_ON_PERF_REGRESSION_PROP
- See Also:
-
PERF_ARGS_FILENAME
- See Also:
-
PERF_DATA_FILENAME
- See Also:
-
PERF_VAR_FILENAME
- See Also:
-
PROPFILE_COMMENT
- See Also:
-
DEFAULT_VARIANCE
-
-
Constructor Details
-
RegressionChecker
- Throws:
IOException
-
RegressionChecker
public RegressionChecker(String perfArgsFileName, String perfHistoryFileName, String perfVarFileName) throws IOException - Throws:
IOException
-
-
Method Details
-
isRegressionCheckEnabled
public static boolean isRegressionCheckEnabled() -
readBooleanProperty
-
isFailOnRegression
public boolean isFailOnRegression()If isFailOnRegression is false then new metrics will not be persisted to the metrics store- Returns:
- whether or not to mark regressions as failures
-
isResetMetrics
public boolean isResetMetrics() -
setFailOnRegression
public void setFailOnRegression(boolean failOnRegression) -
setResetMetrics
public void setResetMetrics(boolean resetMetrics) -
getArg
Convert a String to another type- Type Parameters:
T- the type which args[index] should be converted to- Parameters:
metricName- the name of the test to use if there was a data format errorargs- arguments returned from a prior call togetTestArgs(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)- Returns:
- the converted value
-
getTestArgs
Lookup any configured test arguments- Parameters:
metricName- the name of the test- Returns:
- any test arguments or an empty array if there are none
-
getMatchingMetrics
get metrics matching a particular pattern- Parameters:
pattern- the regex used as the pattern- Returns:
- a map of matching metric names to the current value of the metric
-
getVariance
-