Class PercentageAverageThreshold
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<Threshold>
-
- org.jenkinsci.plugins.benchmark.thresholds.Threshold
-
- org.jenkinsci.plugins.benchmark.thresholds.PercentageAverageThreshold
-
- All Implemented Interfaces:
Describable<Threshold>
public class PercentageAverageThreshold extends Threshold
Percentage threshold compared to average- Since:
- 5/16/2017
- Author:
- Daniel Mercier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PercentageAverageThreshold.DescriptorImpl
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.benchmark.thresholds.Threshold
Threshold.ThresholdTypes
-
-
Constructor Summary
Constructors Constructor Description PercentageAverageThreshold(Double percentage)
PercentageAverageThreshold(String testGroup, String testName, Double percentage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluate(List<? extends Run<?,?>> builds)
Evaluates whether the threshold is activated or notDouble
getAverageValue()
Double
getPercentage()
boolean
isValid(double value)
boolean
isValid(int value)
void
setAverageValue(Double average)
-
Methods inherited from class org.jenkinsci.plugins.benchmark.thresholds.Threshold
all, getDescriptor, getName, getTestGroup, getTestName, getType, setPreviousValue
-
-
-
-
Constructor Detail
-
PercentageAverageThreshold
@DataBoundConstructor public PercentageAverageThreshold(String testGroup, String testName, Double percentage)
-
PercentageAverageThreshold
public PercentageAverageThreshold(Double percentage) throws ValidationException
- Throws:
ValidationException
-
-
Method Detail
-
evaluate
public boolean evaluate(List<? extends Run<?,?>> builds) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, AbortException, ParseException
Description copied from class:Threshold
Evaluates whether the threshold is activated or not- Specified by:
evaluate
in classThreshold
- Parameters:
builds
- all builds that are saved in Jenkins- Returns:
- Successful evaluation
- Throws:
IllegalArgumentException
- if illegal argumentIllegalAccessException
- If illegal accessInvocationTargetException
- If invocation incorrectAbortException
- If action abordedParseException
- If parse failed
-
isValid
public boolean isValid(int value) throws NullPointerException, ValidationException
- Overrides:
isValid
in classThreshold
- Throws:
NullPointerException
ValidationException
-
isValid
public boolean isValid(double value) throws NullPointerException, ValidationException
- Overrides:
isValid
in classThreshold
- Throws:
NullPointerException
ValidationException
-
setAverageValue
public void setAverageValue(Double average)
- Overrides:
setAverageValue
in classThreshold
-
getPercentage
public Double getPercentage()
-
getAverageValue
public Double getAverageValue()
-
-