public class FormulaHelper extends Object
It also provides you formula to do percentage based or threshold value based comparison of metrics between the two given builds
Modifier and Type | Method and Description |
---|---|
static void |
convertBytesIntoMegaBytes(BuildPerformanceData buildPerformanceData) |
static Map<String,Double> |
getAverageValues(BuildPerformanceData buildPerformanceData)
Get the average values of each metric path of the given build's performance data
|
static Map<String,Double> |
getMaxValues(BuildPerformanceData buildPerformanceData)
Get the maximum values of each metric path of the given build's performance data
|
static Map<String,Double> |
getMinValues(BuildPerformanceData buildPerformanceData)
Get the minimum values of each metric path of the given build's performance data
|
static double |
getPercentageChange(double expectedValue,
double actualValue)
Get the percentage change in positive or negative value depending upon the values for any
metric
|
static Map<String,List<TimeSliceValue>> |
getTimeSliceGroupByMetricPath(BuildPerformanceData buildPerformanceData)
Get the Time Slices group by metric path, this is useful to pass the value to output-handler
|
static AgentComparisonResult |
thresholdPercentageBasedCrossBuildMetricPathComparison(double thresholdPercentage,
Map<String,Double> benchMarkValues,
Map<String,Double> currentValues)
This helper method provides you comparison-result w.r.t.
|
static AgentComparisonResult |
thresholdValueBasedCrossBuildMetricPathComparison(double thresholdValue,
Map<String,Double> currentAverageValues)
This helper method provides you comparison-result w.r.t.
|
public static Map<String,List<TimeSliceValue>> getTimeSliceGroupByMetricPath(BuildPerformanceData buildPerformanceData)
buildPerformanceData
- The buildPerformanceData object is retrieved using
MetricDataHelper.getMetricData using the specified argumentspublic static Map<String,Double> getAverageValues(BuildPerformanceData buildPerformanceData)
buildPerformanceData
- The entity you receive from MetricDataHelper on querying the
metricspublic static Map<String,Double> getMaxValues(BuildPerformanceData buildPerformanceData)
buildPerformanceData
- The entity you receive from MetricDataHelper on querying the
metricspublic static Map<String,Double> getMinValues(BuildPerformanceData buildPerformanceData)
buildPerformanceData
- The entity you receive from MetricDataHelper on querying the
metricspublic static double getPercentageChange(double expectedValue, double actualValue)
expectedValue
- The metric value corresponding to bench-mark buildactualValue
- The metric value corresponding to current buildpublic static AgentComparisonResult thresholdPercentageBasedCrossBuildMetricPathComparison(double thresholdPercentage, Map<String,Double> benchMarkValues, Map<String,Double> currentValues)
thresholdPercentage
- The percentage value defined by the user in the strategies
configurationbenchMarkValues
- The bench-mark performance data, which is average, minimum, max or
count, this can be created from other helpers like getAverageValues, getMinValues,
getMaxValues present in this same helper classcurrentValues
- Current performance values of Current Build, per metric-pathpublic static AgentComparisonResult thresholdValueBasedCrossBuildMetricPathComparison(double thresholdValue, Map<String,Double> currentAverageValues)
thresholdValue
- The threshold value defined by the user in the strategies configurationcurrentAverageValues
- The current build's performance data, which is average, minimum,
max or count, this can be created from other helpers like getAverageValues, getMinValues,
getMaxValues present in this same helper classpublic static void convertBytesIntoMegaBytes(BuildPerformanceData buildPerformanceData)
Copyright © 2016–2019. All rights reserved.