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
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractConstraint
(AbstractConstraint.Metric meteredValue, AbstractConstraint.Operator operator, String relatedPerfReport, AbstractConstraint.Escalation escalationLevel, boolean success, TestCaseBlock testCaseBlock) -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<AbstractConstraint>
all()
protected void
checkForDefectiveParams
(List<? extends Run<?, ?>> builds) Checks whether all parameters given in the UI are processable.protected double
checkMetredValueforPerfReport
(AbstractConstraint.Metric meteredValue, PerformanceReport pr) Grabs a specified Metric in a specified PerformanceReportprotected double
checkMetredValueforUriReport
(AbstractConstraint.Metric meteredValue, UriReport ur) Grabs a specified Metric in a specified UriReportabstract AbstractConstraint
clone()
Cloning of a constraint Note that this is not from the Interface Clonableabstract ConstraintEvaluation
Evaluates whether the constraint is fulfilled or violatedboolean
boolean
void
setEscalationLevel
(AbstractConstraint.Escalation escalationLevel) void
setJunitResult
(String junitResult) void
setMeteredValue
(AbstractConstraint.Metric meteredValue) void
setOperator
(AbstractConstraint.Operator operator) void
setRelatedPerfReport
(String relatedPerfReport) void
setResultMessage
(String resultMessage) void
setSettings
(ConstraintSettings settings) void
setSpecifiedTestCase
(boolean isSpecifiedTestCase) void
setSuccess
(boolean success) void
setTestCase
(String testCase) void
setTestCaseBlock
(TestCaseBlock testCaseBlock)
-
Field Details
-
ANY
- See Also:
-
NOW
- See Also:
-
-
Constructor Details
-
AbstractConstraint
protected AbstractConstraint(AbstractConstraint.Metric meteredValue, AbstractConstraint.Operator operator, String relatedPerfReport, AbstractConstraint.Escalation escalationLevel, boolean success, TestCaseBlock testCaseBlock)
-
-
Method Details
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<AbstractConstraint>
-
all
-
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, ParseExceptionEvaluates whether the constraint is fulfilled or violated- Parameters:
builds
- all builds that are saved in Jenkins- Returns:
- Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException
AbortException
ParseException
-
checkMetredValueforUriReport
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
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
-
setResultMessage
-
getJunitResult
-
setJunitResult
-
getRelatedPerfReport
-
setRelatedPerfReport
-
getMeteredValue
-
setMeteredValue
-
getOperator
-
setOperator
-
getEscalationLevel
-
setEscalationLevel
-
getTestCaseBlock
-
setTestCaseBlock
-
isSpecifiedTestCase
public boolean isSpecifiedTestCase() -
setSpecifiedTestCase
public void setSpecifiedTestCase(boolean isSpecifiedTestCase) -
getSettings
-
setSettings
-
getTestCase
-
setTestCase
-