Lines 29-34
Link Here
|
29 |
public class ConfigResults extends AbstractResults { |
29 |
public class ConfigResults extends AbstractResults { |
30 |
BuildResults baseline, current; |
30 |
BuildResults baseline, current; |
31 |
boolean baselined = false, valid = false; |
31 |
boolean baselined = false, valid = false; |
|
|
32 |
double delta, error; |
32 |
|
33 |
|
33 |
public ConfigResults(AbstractResults parent, int id) { |
34 |
public ConfigResults(AbstractResults parent, int id) { |
34 |
super(parent, id); |
35 |
super(parent, id); |
Lines 118-143
Link Here
|
118 |
* @return an array of double. First number is the deviation itself and |
119 |
* @return an array of double. First number is the deviation itself and |
119 |
* the second is the standard error. |
120 |
* the second is the standard error. |
120 |
*/ |
121 |
*/ |
121 |
public double[] getCurrentBuildDeviation() { |
122 |
public double[] getCurrentBuildDeltaInfo() { |
122 |
if (this.baseline == null || this.current == null) initialize(); |
123 |
if (this.baseline == null || this.current == null) { |
123 |
int dim_id = SUPPORTED_DIMS[0].getId(); |
124 |
initialize(); |
124 |
double baselineValue = this.baseline.getValue(dim_id); |
125 |
} |
125 |
double currentValue = this.current.getValue(dim_id); |
126 |
return new double[] { this.delta, this.error }; |
126 |
double deviation = (currentValue - baselineValue) / baselineValue; |
|
|
127 |
if (Double.isNaN(deviation)) { |
128 |
return new double[] { Double.NaN, Double.NaN }; |
129 |
} |
130 |
long baselineCount = this.baseline.getCount(dim_id); |
131 |
long currentCount = this.current.getCount(dim_id); |
132 |
if (baselineCount == 1 || currentCount == 1) { |
133 |
return new double[] { deviation, Double.NaN }; |
134 |
} |
135 |
double baselineError = this.baseline.getError(dim_id); |
136 |
double currentError = this.current.getError(dim_id); |
137 |
double stderr = Double.isNaN(baselineError) |
138 |
? currentError / baselineValue |
139 |
: Math.sqrt(baselineError*baselineError + currentError*currentError) / baselineValue; |
140 |
return new double[] { deviation, stderr }; |
141 |
} |
127 |
} |
142 |
|
128 |
|
143 |
/** |
129 |
/** |
Lines 244-249
Link Here
|
244 |
if (this.current == null) { |
230 |
if (this.current == null) { |
245 |
this.current = (BuildResults) this.children.get(size()-1); |
231 |
this.current = (BuildResults) this.children.get(size()-1); |
246 |
} |
232 |
} |
|
|
233 |
|
234 |
// Set delta between current vs. baseline and the corresponding error |
235 |
int dim_id = DEFAULT_DIM.getId(); |
236 |
double baselineValue = this.baseline.getValue(dim_id); |
237 |
double currentValue = this.current.getValue(dim_id); |
238 |
this.delta = (currentValue - baselineValue) / baselineValue; |
239 |
if (Double.isNaN(this.delta)) { |
240 |
this.error = Double.NaN; |
241 |
} else { |
242 |
long baselineCount = this.baseline.getCount(dim_id); |
243 |
long currentCount = this.current.getCount(dim_id); |
244 |
if (baselineCount == 1 || currentCount == 1) { |
245 |
this.error = Double.NaN; |
246 |
} else { |
247 |
double baselineError = this.baseline.getError(dim_id); |
248 |
double currentError = this.current.getError(dim_id); |
249 |
this.error = Double.isNaN(baselineError) |
250 |
? currentError / baselineValue |
251 |
: Math.sqrt(baselineError*baselineError + currentError*currentError) / baselineValue; |
252 |
} |
253 |
} |
254 |
|
255 |
// Set the failure on the current build if necessary |
256 |
int failure_threshold = getPerformance().failure_threshold; |
257 |
if (this.delta >= (failure_threshold/100.0)) { |
258 |
StringBuffer buffer = new StringBuffer("Performance criteria not met when compared to '"); //$NON-NLS-1$ |
259 |
buffer.append(this.baseline.getName()); |
260 |
buffer.append("': "); //$NON-NLS-1$ |
261 |
buffer.append(DEFAULT_DIM.getName()); |
262 |
buffer.append("= "); //$NON-NLS-1$ |
263 |
buffer.append(timeString((long)this.current.getValue())); |
264 |
buffer.append(" is not within [0%, "); //$NON-NLS-1$ |
265 |
buffer.append(100+failure_threshold); |
266 |
buffer.append("'%] of "); //$NON-NLS-1$ |
267 |
buffer.append(timeString((long)this.baseline.getValue())); |
268 |
this.current.setFailure(buffer.toString()); |
269 |
} |
247 |
} |
270 |
} |
248 |
|
271 |
|
249 |
/** |
272 |
/** |