Class AbstractConstraint
- java.lang.Object
-
- hudson.plugins.performance.constraints.AbstractConstraint
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<AbstractConstraint>
- Direct Known Subclasses:
AbsoluteConstraint
,RelativeConstraint
public abstract class AbstractConstraint extends Object implements Describable<AbstractConstraint>, ExtensionPoint
Parent class for AbsoluteConstraint and RelativeConstraint- Author:
- Rene Kugel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractConstraint.Escalation
static class
AbstractConstraint.Metric
static class
AbstractConstraint.Operator
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractConstraint(AbstractConstraint.Metric meteredValue, AbstractConstraint.Operator operator, String relatedPerfReport, AbstractConstraint.Escalation escalationLevel, boolean success, TestCaseBlock testCaseBlock)
-
Method Summary
-
-
-
Field Detail
-
ANY
public static final String ANY
- See Also:
- Constant Field Values
-
NOW
protected static final String NOW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractConstraint
protected AbstractConstraint(AbstractConstraint.Metric meteredValue, AbstractConstraint.Operator operator, String relatedPerfReport, AbstractConstraint.Escalation escalationLevel, boolean success, TestCaseBlock testCaseBlock)
-
-
Method Detail
-
getDescriptor
public ConstraintDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<AbstractConstraint>
-
all
public static ExtensionList<AbstractConstraint> all()
-
clone
public abstract AbstractConstraint clone()
Cloning of a constraint Note that this is not from the Interface Clonable
-
evaluate
public abstract ConstraintEvaluation evaluate(List<? extends Run<?,?>> builds) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, AbortException, ParseException
Evaluates whether the constraint is fulfilled or violated- Parameters:
builds
- all builds that are saved in Jenkins- Returns:
- Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException
AbortException
ParseException
-
checkMetredValueforUriReport
protected double checkMetredValueforUriReport(AbstractConstraint.Metric meteredValue, UriReport ur)
Grabs a specified Metric in a specified UriReport- Parameters:
meteredValue
- the metric that should be evaluatedur
- the UriReport where the metric should be measured- Returns:
- the value of the specified metric in the specified UriReport
-
checkMetredValueforPerfReport
protected double checkMetredValueforPerfReport(AbstractConstraint.Metric meteredValue, PerformanceReport pr)
Grabs a specified Metric in a specified PerformanceReport- Parameters:
meteredValue
- the metric that should be evaluatedpr
- the PerformanceReport where the metric should be measured- Returns:
- the value of the specified metric in the specified PerformanceReport
-
checkForDefectiveParams
protected void checkForDefectiveParams(List<? extends Run<?,?>> builds) throws AbortException
Checks whether all parameters given in the UI are processable.- Parameters:
builds
- all stored jenkins builds- Throws:
AbortException
- if a parameter in the UI is not processable
-
setSuccess
public void setSuccess(boolean success)
-
getSuccess
public boolean getSuccess()
-
getResultMessage
public String getResultMessage()
-
setResultMessage
public void setResultMessage(String resultMessage)
-
getJunitResult
public String getJunitResult()
-
setJunitResult
public void setJunitResult(String junitResult)
-
getRelatedPerfReport
public String getRelatedPerfReport()
-
setRelatedPerfReport
public void setRelatedPerfReport(String relatedPerfReport)
-
getMeteredValue
public AbstractConstraint.Metric getMeteredValue()
-
setMeteredValue
public void setMeteredValue(AbstractConstraint.Metric meteredValue)
-
getOperator
public AbstractConstraint.Operator getOperator()
-
setOperator
public void setOperator(AbstractConstraint.Operator operator)
-
getEscalationLevel
public AbstractConstraint.Escalation getEscalationLevel()
-
setEscalationLevel
public void setEscalationLevel(AbstractConstraint.Escalation escalationLevel)
-
getTestCaseBlock
public TestCaseBlock getTestCaseBlock()
-
setTestCaseBlock
public void setTestCaseBlock(TestCaseBlock testCaseBlock)
-
isSpecifiedTestCase
public boolean isSpecifiedTestCase()
-
setSpecifiedTestCase
public void setSpecifiedTestCase(boolean isSpecifiedTestCase)
-
getSettings
public ConstraintSettings getSettings()
-
setSettings
public void setSettings(ConstraintSettings settings)
-
getTestCase
public String getTestCase()
-
setTestCase
public void setTestCase(String testCase)
-
-