Class IntegerValue
- java.lang.Object
-
- org.jenkinsci.plugins.benchmark.results.TestGroup
-
- org.jenkinsci.plugins.benchmark.results.TestValue
-
- org.jenkinsci.plugins.benchmark.results.NumeralValue
-
- org.jenkinsci.plugins.benchmark.results.IntegerValue
-
- Direct Known Subclasses:
IntegerCondensed
public class IntegerValue extends NumeralValue
Holds the information for integer test result- Since:
- 5/10/2017
- Author:
- Daniel Mercier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.benchmark.results.TestValue
TestValue.ValueType
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.benchmark.results.TestGroup
TestGroup.ClassType
-
-
Field Summary
Fields Modifier and Type Field Description protected ConcurrentHashMap<Integer,Integer>
values
-
Fields inherited from class org.jenkinsci.plugins.benchmark.results.TestValue
FAILED_STATE_COLOR, group, PASSED_STATE_COLOR, properties, type, unit
-
Fields inherited from class org.jenkinsci.plugins.benchmark.results.TestGroup
ctype, description, groupHash, groups, name, parent, thresholds
-
-
Constructor Summary
Constructors Constructor Description IntegerValue(TestGroup parent, String group, String name)
IntegerValue(TestGroup parent, String group, String name, String unit)
IntegerValue(TestGroup parent, String group, String name, String description, String unit)
IntegerValue(TestGroup parent, String group, String name, String description, String unit, TestGroup.ClassType ctype)
IntegerValue(TestGroup parent, String group, String name, String unit, TestGroup.ClassType ctype)
IntegerValue(TestGroup parent, String name, String unit, TestGroup.ClassType ctype)
IntegerValue(TestGroup parent, String name, TestGroup.ClassType ctype)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
calculateAverage()
Calculate averagevoid
checkThresholdStatus(Double previous, Double average)
Check attached thresholds to verify result validity.com.google.gson.JsonObject
getCondensedJsonObject(int build, int hash)
Create an JSON object with the condensed information of this resultcom.google.gson.JsonArray
getDataAsJsonArray(TreeSet<Integer> buildNumbers)
Create JSON object containing all results necessary to display the graph [DETAIL PAGE]com.google.gson.JsonObject
getJsonObject(int hash)
Get last build result content in Json Object [EXPORT RAW] Works with TestValue getJsonObject()Double
getPreviousValue(int build)
Get previous build valueInteger
getValue()
Integer
getValue(int build)
String
getValueAsLocaleString(int build, char decimalSeparator)
Return last value as string in locale format [TABLE PAGE][DETAIL PAGE]String
getValueAsString(int build)
Return last value as string in default locale [TABLE PAGE][DETAIL PAGE]Map<Integer,Integer>
getValues()
void
setValue(int value)
void
setValue(int build, int value)
-
Methods inherited from class org.jenkinsci.plugins.benchmark.results.NumeralValue
getMaximum, getMinimum
-
Methods inherited from class org.jenkinsci.plugins.benchmark.results.TestValue
checkType, convertCondensedParameterJsonObject, convertCondensedResultJsonObject, convertParameterJsonObject, convertResultJsonObject, getColor, getCSVCondensed, getCSVResult, getCSVResultState, getFailedState, getFailedState, getGroup, getHTMLCondensed, getHTMLCondensedDetail, getHTMLDetails, getHTMLParameter, getHTMLParameters, getHTMLResult, getHTMLResult, getId, getId, getMessages, getMessages, getNumberOfProperties, getParameterJsonObject, getParameters, getParameters, getProperties, getType, getUnit, isNumeral, outputType, setFailedState, setFailedState, setGroup, setGroup, setId, setId, setMessage, setMessage, setMessages, setMessages, setParameter, setParameter, setParameters, setParameters
-
Methods inherited from class org.jenkinsci.plugins.benchmark.results.TestGroup
addGroup, addThreshold, convertCondensedFileJsonObject, getAllConnectedParameters, getAllConnectedThresholds, getClassType, getConnectedParameters, getConnectedParentParameters, getConnectedParentThresholds, getConnectedThresholds, getDescription, getDescriptions, getFileGroup, getFileHash, getFileSubGroupFullName, getFullName, getGroup, getGroupHash, getName, getNumberOfGroups, getNumberOfThresholds, getParent, getTestGroups, getThreshold, isArray, isParameterGrp, isThresholdGrp
-
-
-
-
Field Detail
-
values
protected final ConcurrentHashMap<Integer,Integer> values
-
-
Constructor Detail
-
IntegerValue
public IntegerValue(TestGroup parent, String group, String name, String description, String unit)
-
IntegerValue
public IntegerValue(TestGroup parent, String name, TestGroup.ClassType ctype)
-
IntegerValue
public IntegerValue(TestGroup parent, String name, String unit, TestGroup.ClassType ctype)
-
IntegerValue
public IntegerValue(TestGroup parent, String group, String name, String unit, TestGroup.ClassType ctype)
-
-
Method Detail
-
getPreviousValue
public Double getPreviousValue(int build)
Get previous build value- Parameters:
build
- Build number- Returns:
- previous
-
calculateAverage
public Double calculateAverage()
Calculate average- Returns:
- average
-
getCondensedJsonObject
public com.google.gson.JsonObject getCondensedJsonObject(int build, int hash)
Create an JSON object with the condensed information of this result- Overrides:
getCondensedJsonObject
in classTestValue
- Parameters:
build
- Build numberhash
- Result hash- Returns:
- JSON object
-
getDataAsJsonArray
public com.google.gson.JsonArray getDataAsJsonArray(TreeSet<Integer> buildNumbers) throws InvalidClassException
Create JSON object containing all results necessary to display the graph [DETAIL PAGE]- Overrides:
getDataAsJsonArray
in classTestValue
- Parameters:
buildNumbers
- List of builds- Returns:
- Json object
- Throws:
InvalidClassException
- Invalid class
-
getJsonObject
public com.google.gson.JsonObject getJsonObject(int hash)
Get last build result content in Json Object [EXPORT RAW] Works with TestValue getJsonObject()- Overrides:
getJsonObject
in classTestValue
- Parameters:
hash
- Result hash- Returns:
- Json object
-
getValueAsString
public String getValueAsString(int build)
Return last value as string in default locale [TABLE PAGE][DETAIL PAGE]- Overrides:
getValueAsString
in classTestValue
- Parameters:
build
- Build number- Returns:
- String of value
-
getValueAsLocaleString
public String getValueAsLocaleString(int build, char decimalSeparator)
Return last value as string in locale format [TABLE PAGE][DETAIL PAGE]- Overrides:
getValueAsLocaleString
in classTestValue
- Parameters:
build
- Build numberdecimalSeparator
- Decimal separator- Returns:
- String of value
-
checkThresholdStatus
public void checkThresholdStatus(Double previous, Double average)
Check attached thresholds to verify result validity.- Overrides:
checkThresholdStatus
in classTestValue
- Parameters:
previous
- Previous valueaverage
- Calculated average
-
setValue
public void setValue(int value)
-
setValue
public void setValue(int build, int value)
-
getValue
public Integer getValue() throws NullPointerException
- Throws:
NullPointerException
-
getValue
public Integer getValue(int build) throws NullPointerException
- Throws:
NullPointerException
-
-