Lines 52-80
Link Here
|
52 |
|
52 |
|
53 |
public class Utils { |
53 |
public class Utils { |
54 |
|
54 |
|
55 |
public final static String TTEST_FAILURE_MESSAGE="There is not enough evidence to reject the null hypothesis at the 90% level (Student's t-test)."; |
55 |
public final static double STANDARD_ERROR_THRESHOLD = 0.03; // 3% |
56 |
public final static double STANDARD_ERROR_THRESHOLD = 0.02; // 2% |
|
|
57 |
static final NumberFormat PERCENT_FORMAT = NumberFormat.getPercentInstance(); |
56 |
static final NumberFormat PERCENT_FORMAT = NumberFormat.getPercentInstance(); |
58 |
static { |
57 |
static { |
59 |
PERCENT_FORMAT.setMaximumFractionDigits(1); |
58 |
PERCENT_FORMAT.setMaximumFractionDigits(1); |
60 |
} |
59 |
} |
61 |
public final static String STANDARD_ERROR_THRESHOLD_STRING =PERCENT_FORMAT.format(STANDARD_ERROR_THRESHOLD); |
60 |
static final NumberFormat DOUBLE_FORMAT = NumberFormat.getNumberInstance(); |
62 |
public final static String TTEST_MODERATION_MESSAGE="Student's t-test failed at the 90% level but it's moderated with standard error lower than "+STANDARD_ERROR_THRESHOLD_STRING; |
61 |
static { |
|
|
62 |
DOUBLE_FORMAT.setMaximumIntegerDigits(2); |
63 |
DOUBLE_FORMAT.setMaximumFractionDigits(1); |
64 |
} |
65 |
public final static String STANDARD_ERROR_THRESHOLD_STRING = PERCENT_FORMAT.format(STANDARD_ERROR_THRESHOLD); |
63 |
public final static String STANDARD_ERROR_MESSAGE="Standard error on this test is higher than "+STANDARD_ERROR_THRESHOLD_STRING; |
66 |
public final static String STANDARD_ERROR_MESSAGE="Standard error on this test is higher than "+STANDARD_ERROR_THRESHOLD_STRING; |
64 |
public final static String OK_IMAGE="OK.gif"; |
67 |
public final static String OK_IMAGE="OK.gif"; |
65 |
public final static String OK_IMAGE_ERR="OK_err.gif"; |
|
|
66 |
public final static String OK_IMAGE_TTEST="OK_ttest.gif"; |
67 |
public final static String OK_IMAGE_WARN="OK_caution.gif"; |
68 |
public final static String OK_IMAGE_WARN="OK_caution.gif"; |
68 |
public final static String FAIL_IMAGE="FAIL.gif"; |
69 |
public final static String FAIL_IMAGE="FAIL.gif"; |
69 |
public final static String FAIL_IMAGE_TTEST="FAIL_ttest.gif"; |
|
|
70 |
public final static String FAIL_IMAGE_ERR="FAIL_err.gif"; |
71 |
public final static String FAIL_IMAGE_WARN="FAIL_caution.gif"; |
70 |
public final static String FAIL_IMAGE_WARN="FAIL_caution.gif"; |
72 |
public final static String FAIL_IMAGE_EXPLAINED="FAIL_greyed.gif"; |
71 |
public final static String FAIL_IMAGE_EXPLAINED="FAIL_greyed.gif"; |
73 |
public final static int OK = 0; |
72 |
public final static int OK = 0; |
74 |
public final static int ERR = 0x1; |
73 |
public final static int SIGN = 0x1; |
75 |
public final static int TTEST = 0x2; |
74 |
public final static int ERR = 0x2; |
|
|
75 |
// public final static int TTEST = 0x2; |
76 |
public final static int DEV = 0x4; |
76 |
public final static int DEV = 0x4; |
77 |
private final static int NOT_SIGNIFICANT = ERR | TTEST; |
|
|
78 |
|
77 |
|
79 |
/** |
78 |
/** |
80 |
* @param dimension |
79 |
* @param dimension |
Lines 139-151
Link Here
|
139 |
} |
138 |
} |
140 |
|
139 |
|
141 |
/** |
140 |
/** |
142 |
* @return <html><head><meta http-equiv="Content-Type" |
141 |
* Return <html><head><meta http-equiv="Content-Type" |
143 |
* content="text/html; charset=iso-8859-1"> |
142 |
* content="text/html; charset=iso-8859-1"> |
144 |
*/ |
143 |
*/ |
145 |
public static String HTML_OPEN = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">"; |
144 |
public static String HTML_OPEN = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">"; |
146 |
|
145 |
|
147 |
/** |
146 |
/** |
148 |
* @return "</html>". |
147 |
* Return "</html>". |
149 |
*/ |
148 |
*/ |
150 |
public static String HTML_CLOSE = "</html>"; |
149 |
public static String HTML_CLOSE = "</html>"; |
151 |
|
150 |
|
Lines 170-176
Link Here
|
170 |
String description; |
169 |
String description; |
171 |
|
170 |
|
172 |
/** |
171 |
/** |
173 |
* |
172 |
* |
174 |
* @param name |
173 |
* @param name |
175 |
* the value specifed for the key config in the |
174 |
* the value specifed for the key config in the |
176 |
* eclipse.perf.config system.property key value listings. |
175 |
* eclipse.perf.config system.property key value listings. |
Lines 183-195
Link Here
|
183 |
this.name = name; |
182 |
this.name = name; |
184 |
this.description = description; |
183 |
this.description = description; |
185 |
} |
184 |
} |
186 |
|
185 |
|
187 |
public String getName() { |
186 |
public String getName() { |
188 |
return name; |
187 |
return name; |
189 |
} |
188 |
} |
190 |
|
189 |
|
191 |
public boolean descriptionMatches(String description) { |
190 |
public boolean descriptionMatches(String descr) { |
192 |
return description.equals(this.description); |
191 |
return descr.equals(this.description); |
193 |
} |
192 |
} |
194 |
} |
193 |
} |
195 |
|
194 |
|
Lines 218-224
Link Here
|
218 |
/** |
217 |
/** |
219 |
* Queries database with variation composed of buildIdPattern, config and |
218 |
* Queries database with variation composed of buildIdPattern, config and |
220 |
* jvm. |
219 |
* jvm. |
221 |
* |
220 |
* |
222 |
* @return Array of scenarios. |
221 |
* @return Array of scenarios. |
223 |
*/ |
222 |
*/ |
224 |
public static Scenario[] getScenarios(String buildIdPattern, String scenarioPattern, String config, String jvm) { |
223 |
public static Scenario[] getScenarios(String buildIdPattern, String scenarioPattern, String config, String jvm) { |
Lines 232-238
Link Here
|
232 |
|
231 |
|
233 |
/** |
232 |
/** |
234 |
* Creates a Variations object using build id pattern, config and jvm. |
233 |
* Creates a Variations object using build id pattern, config and jvm. |
235 |
* |
234 |
* |
236 |
* @param buildIdPattern |
235 |
* @param buildIdPattern |
237 |
* @param config |
236 |
* @param config |
238 |
* @param jvm |
237 |
* @param jvm |
Lines 291-303
Link Here
|
291 |
|
290 |
|
292 |
/** |
291 |
/** |
293 |
* Utility method to copy a file. |
292 |
* Utility method to copy a file. |
294 |
* |
293 |
* |
295 |
* @param src - |
294 |
* @param src the source file. |
296 |
* the source file. |
295 |
* @param dest the destination. |
297 |
* @param dest - |
|
|
298 |
* the destination. |
299 |
*/ |
296 |
*/ |
300 |
public static void copyFile(File src, String dest) { |
297 |
private static void copyFile(File src, File dest) { |
301 |
|
298 |
|
302 |
try { |
299 |
try { |
303 |
InputStream in = new FileInputStream(src); |
300 |
InputStream in = new FileInputStream(src); |
Lines 316-326
Link Here
|
316 |
e.printStackTrace(); |
313 |
e.printStackTrace(); |
317 |
} |
314 |
} |
318 |
} |
315 |
} |
|
|
316 |
public static void copyImages(File images, File output) { |
317 |
copyFile(new File(images, Utils.FAIL_IMAGE), new File(output, Utils.FAIL_IMAGE)); |
318 |
copyFile(new File(images, Utils.FAIL_IMAGE_EXPLAINED), new File(output, Utils.FAIL_IMAGE_EXPLAINED)); |
319 |
copyFile(new File(images, Utils.FAIL_IMAGE_WARN), new File(output, Utils.FAIL_IMAGE_WARN)); |
320 |
copyFile(new File(images, Utils.OK_IMAGE), new File(output, Utils.OK_IMAGE)); |
321 |
copyFile(new File(images, Utils.OK_IMAGE_WARN), new File(output, Utils.OK_IMAGE_WARN)); |
322 |
} |
323 |
public static void copyScripts(File scripts, File output) { |
324 |
copyFile(new File(scripts, "ToolTip.css"), new File(output, "ToolTip.css")); |
325 |
copyFile(new File(scripts, "ToolTip.js"), new File(output, "ToolTip.js")); |
326 |
} |
319 |
|
327 |
|
320 |
/** |
328 |
/** |
321 |
* Returns a LineGraph object representing measurements for a scenario over |
329 |
* Returns a LineGraph object representing measurements for a scenario over |
322 |
* builds. |
330 |
* builds. |
323 |
* |
331 |
* |
324 |
* @param t - |
332 |
* @param t - |
325 |
* the scenario object. |
333 |
* the scenario object. |
326 |
* @param dimensionName - |
334 |
* @param dimensionName - |
Lines 368-374
Link Here
|
368 |
Color color = black; |
376 |
Color color = black; |
369 |
if (buildID.startsWith("N")) |
377 |
if (buildID.startsWith("N")) |
370 |
color = yellow; |
378 |
color = yellow; |
371 |
|
379 |
|
372 |
graph.addItem("main", label, dim.getDisplayValue(value), value, color, true, getDateFromBuildID(buildID), true); |
380 |
graph.addItem("main", label, dim.getDisplayValue(value), value, color, true, getDateFromBuildID(buildID), true); |
373 |
continue; |
381 |
continue; |
374 |
} |
382 |
} |
Lines 392-398
Link Here
|
392 |
continue; |
400 |
continue; |
393 |
} else if (buildID.startsWith("N")) |
401 |
} else if (buildID.startsWith("N")) |
394 |
continue; |
402 |
continue; |
395 |
|
403 |
|
396 |
for (int i=0;i<currentBuildIdPrefixes.size();i++){ |
404 |
for (int i=0;i<currentBuildIdPrefixes.size();i++){ |
397 |
if (buildID.startsWith(currentBuildIdPrefixes.get(i).toString())&&!currentFound) { |
405 |
if (buildID.startsWith(currentBuildIdPrefixes.get(i).toString())&&!currentFound) { |
398 |
graph.addItem("main", buildID, dim.getDisplayValue(value), value, black, false, getDateFromBuildID(buildID), false); |
406 |
graph.addItem("main", buildID, dim.getDisplayValue(value), value, black, false, getDateFromBuildID(buildID), false); |
Lines 410-416
Link Here
|
410 |
|
418 |
|
411 |
/** |
419 |
/** |
412 |
* Prints a LineGraph object as a gif |
420 |
* Prints a LineGraph object as a gif |
413 |
* |
421 |
* |
414 |
* @param p - |
422 |
* @param p - |
415 |
* the LineGraph object. |
423 |
* the LineGraph object. |
416 |
* @param output - |
424 |
* @param output - |
Lines 450-456
Link Here
|
450 |
/** |
458 |
/** |
451 |
* Utility method which returns HTML code representing an image map for a |
459 |
* Utility method which returns HTML code representing an image map for a |
452 |
* LineGraph object. |
460 |
* LineGraph object. |
453 |
* |
461 |
* |
454 |
* @param p - |
462 |
* @param p - |
455 |
* the LineGraph object. |
463 |
* the LineGraph object. |
456 |
* @param imageSource - |
464 |
* @param imageSource - |
Lines 470-476
Link Here
|
470 |
|
478 |
|
471 |
/** |
479 |
/** |
472 |
* A utility which returns the index of a given buildId in an array. |
480 |
* A utility which returns the index of a given buildId in an array. |
473 |
* |
481 |
* |
474 |
* @param timeSeriesLabels - |
482 |
* @param timeSeriesLabels - |
475 |
* array of buildIds |
483 |
* array of buildIds |
476 |
* @param buildId - |
484 |
* @param buildId - |
Lines 586-592
Link Here
|
586 |
|
594 |
|
587 |
/** |
595 |
/** |
588 |
* Returns the date/time from the build id in format yyyymmddhm |
596 |
* Returns the date/time from the build id in format yyyymmddhm |
589 |
* |
597 |
* |
590 |
* @param buildId |
598 |
* @param buildId |
591 |
* @return date/time in format YYYYMMDDHHMM, ie. 200504060010 |
599 |
* @return date/time in format YYYYMMDDHHMM, ie. 200504060010 |
592 |
*/ |
600 |
*/ |
Lines 650-662
Link Here
|
650 |
out = new PrintWriter(new FileWriter(new File(outputFile))); |
658 |
out = new PrintWriter(new FileWriter(new File(outputFile))); |
651 |
out.println(Utils.HTML_OPEN + "</head><body>\n"); |
659 |
out.println(Utils.HTML_OPEN + "</head><body>\n"); |
652 |
out.println("<h3>Summary of Elapsed Process Variation Coefficients</h3>\n"+ |
660 |
out.println("<h3>Summary of Elapsed Process Variation Coefficients</h3>\n"+ |
653 |
"<p> This table provides a bird's eye view of variability in elapsed process times\n"+ |
661 |
"<p> This table provides a bird's eye view of variability in elapsed process times\n"+ |
654 |
"for baseline and current build stream performance scenarios." + |
662 |
"for baseline and current build stream performance scenarios." + |
655 |
" This summary is provided to facilitate the identification of scenarios that should be examined due to high variability." + |
663 |
" This summary is provided to facilitate the identification of scenarios that should be examined due to high variability." + |
656 |
"The variability for each scenario is expressed as a <a href=\"http://en.wikipedia.org/wiki/Coefficient_of_variation\">coefficient\n"+ |
664 |
"The variability for each scenario is expressed as a <a href=\"http://en.wikipedia.org/wiki/Coefficient_of_variation\">coefficient\n"+ |
657 |
"of variation</a> (CV). The CV is calculated by dividing the <b>standard deviation\n"+ |
665 |
"of variation</a> (CV). The CV is calculated by dividing the <b>standard deviation\n"+ |
658 |
"of the elapse process time over builds</b> by the <b>average elapsed process\n"+ |
666 |
"of the elapse process time over builds</b> by the <b>average elapsed process\n"+ |
659 |
"time over builds</b> and multiplying by 100.\n"+ |
667 |
"time over builds</b> and multiplying by 100.\n"+ |
660 |
"</p><p>High CV values may be indicative of any of the following:<br></p>\n"+ |
668 |
"</p><p>High CV values may be indicative of any of the following:<br></p>\n"+ |
661 |
"<ol><li> an unstable performance test. </li>\n"+ |
669 |
"<ol><li> an unstable performance test. </li>\n"+ |
662 |
"<ul><li>may be evidenced by an erratic elapsed process line graph.<br><br></li></ul>\n"+ |
670 |
"<ul><li>may be evidenced by an erratic elapsed process line graph.<br><br></li></ul>\n"+ |
Lines 665-692
Link Here
|
665 |
"<li>unstable testing hardware.\n" + |
673 |
"<li>unstable testing hardware.\n" + |
666 |
"<ul><li>consistent higher CV values for one test configuration as compared to others across" + |
674 |
"<ul><li>consistent higher CV values for one test configuration as compared to others across" + |
667 |
" scenarios may be related to hardward problems.</li></ul></li></ol>\n"+ |
675 |
" scenarios may be related to hardward problems.</li></ul></li></ol>\n"+ |
668 |
"<p> Scenarios are listed in alphabetical order in the far right column. A scenario's\n"+ |
676 |
"<p> Scenarios are listed in alphabetical order in the far right column. A scenario's\n"+ |
669 |
"variation coefficients (CVs) are in columns to the left for baseline and current\n"+ |
677 |
"variation coefficients (CVs) are in columns to the left for baseline and current\n"+ |
670 |
"build streams for each test configuration. Scenarios with CVs > 10% are highlighted\n"+ |
678 |
"build streams for each test configuration. Scenarios with CVs > 10% are highlighted\n"+ |
671 |
"in yellow (10%<CV><CV<20%) and orange(CV>20%). </p>\n"+ |
679 |
"in yellow (10%<CV><CV<20%) and orange(CV>20%). </p>\n"+ |
672 |
"<p> Each CV value links to the scenario's detailed results to allow viewers to\n"+ |
680 |
"<p> Each CV value links to the scenario's detailed results to allow viewers to\n"+ |
673 |
"investigate the variability.</p>\n"); |
681 |
"investigate the variability.</p>\n"); |
674 |
|
682 |
|
675 |
Hashtable cvTable = (Hashtable) rawDataTables.get(scenarios[0]); |
683 |
Hashtable cvTable = (Hashtable) rawDataTables.get(scenarios[0]); |
676 |
String[] configNames = (String[]) cvTable.keySet().toArray(new String[cvTable.size()]); |
684 |
String[] configNames = (String[]) cvTable.keySet().toArray(new String[cvTable.size()]); |
677 |
Arrays.sort(configNames); |
685 |
Arrays.sort(configNames); |
678 |
|
686 |
|
679 |
|
687 |
|
680 |
int configColumns=configNames.length/2; |
688 |
int configColumns=configNames.length/2; |
681 |
out.println("<table border=\"1\"><tr>" + |
689 |
out.println("<table border=\"1\"><tr>" + |
682 |
"<td colspan=\""+configColumns+"\"><b>Baseline CVs</b></td>"+ |
690 |
"<td colspan=\""+configColumns+"\"><b>Baseline CVs</b></td>"+ |
683 |
"<td colspan=\""+configColumns+"\"><b>Current Build Stream CVs</b></td>"+ |
691 |
"<td colspan=\""+configColumns+"\"><b>Current Build Stream CVs</b></td>"+ |
684 |
"<td rowspan=\"2\"><b>Scenario Name</b></td>"+ |
692 |
"<td rowspan=\"2\"><b>Scenario Name</b></td>"+ |
685 |
"</tr><tr>"); |
693 |
"</tr><tr>"); |
686 |
|
694 |
|
687 |
|
695 |
|
688 |
for (int i = 0; i < configNames.length; i++) { |
696 |
for (int i = 0; i < configNames.length; i++) { |
689 |
//configNames here have prefix cConfig- or bConfig- depending on whether the data comes from |
697 |
//configNames here have prefix cConfig- or bConfig- depending on whether the data comes from |
690 |
//current build stream data or baseline data. |
698 |
//current build stream data or baseline data. |
691 |
out.print("<td>" + ((ConfigDescriptor)configDescriptors.get(configNames[i].substring(8))).description + "</td>"); |
699 |
out.print("<td>" + ((ConfigDescriptor)configDescriptors.get(configNames[i].substring(8))).description + "</td>"); |
692 |
} |
700 |
} |
Lines 696-702
Link Here
|
696 |
Hashtable aCvTable = (Hashtable) rawDataTables.get(scenarios[i]); |
704 |
Hashtable aCvTable = (Hashtable) rawDataTables.get(scenarios[i]); |
697 |
String scenario = scenarios[i]; |
705 |
String scenario = scenarios[i]; |
698 |
String scenarioFile=scenario.replace('#', '.').replace(':', '_').replace('\\', '_')+".html"; |
706 |
String scenarioFile=scenario.replace('#', '.').replace(':', '_').replace('\\', '_')+".html"; |
699 |
|
707 |
|
700 |
for (int j = 0; j < configNames.length; j++) { |
708 |
for (int j = 0; j < configNames.length; j++) { |
701 |
String url=configNames[j].substring(8)+"/"+scenarioFile; |
709 |
String url=configNames[j].substring(8)+"/"+scenarioFile; |
702 |
if (aCvTable.get(configNames[j]) == null) { |
710 |
if (aCvTable.get(configNames[j]) == null) { |
Lines 776-823
Link Here
|
776 |
|
784 |
|
777 |
public static boolean hasConfidentResult(Variations variations, String scenarioName, String baseline, String config) { |
785 |
public static boolean hasConfidentResult(Variations variations, String scenarioName, String baseline, String config) { |
778 |
double[] resultStats = resultStats(variations, scenarioName, baseline, config); |
786 |
double[] resultStats = resultStats(variations, scenarioName, baseline, config); |
779 |
if (resultStats != null) { |
787 |
return (confidenceLevel(resultStats) & ERR) == 0; |
780 |
return resultStats[1] < 0 || resultStats[0] < resultStats[1] || resultStats[2] < STANDARD_ERROR_THRESHOLD; |
|
|
781 |
} |
782 |
return true; |
783 |
} |
788 |
} |
784 |
public static String failureMessage(Variations variations, String scenarioName, String baseline, String config, boolean prefix) { |
789 |
public static String failureMessage(Variations variations, String scenarioName, String baseline, String config) { |
785 |
return failureMessage(resultStats(variations, scenarioName, baseline, config), prefix); |
790 |
return failureMessage(resultStats(variations, scenarioName, baseline, config), true); |
786 |
} |
791 |
} |
787 |
public static String failureMessage(double[] resultStats, boolean prefix) { |
792 |
public static String failureMessage(double[] resultStats, boolean full) { |
788 |
StringBuffer buffer = null; |
793 |
StringBuffer buffer = new StringBuffer(); |
789 |
switch (confidenceLevel(resultStats)) { |
794 |
int level = confidenceLevel(resultStats); |
790 |
case ERR: |
795 |
boolean signal = (level & SIGN) != 0; |
791 |
buffer = new StringBuffer(); |
796 |
boolean isErr = (level & ERR) != 0; |
792 |
if (prefix) buffer.append("*** INFO *** "); |
797 |
if (full & isErr) { |
793 |
buffer.append(STANDARD_ERROR_MESSAGE); |
798 |
buffer.append("*** WARNING *** "); |
794 |
buffer.append(" ("); |
799 |
buffer.append(STANDARD_ERROR_MESSAGE); |
795 |
buffer.append(PERCENT_FORMAT.format(resultStats[2])); |
800 |
} |
796 |
buffer.append(")"); |
801 |
if (!full) buffer.append("<font color=\"#0000FF\" size=\"1\"> "); |
797 |
break; |
802 |
if (resultStats != null) { |
798 |
case TTEST: |
803 |
double deviation = resultStats[3]==0 ? 0 : -resultStats[3]; |
799 |
buffer = new StringBuffer(); |
804 |
if (deviation > 0) { |
800 |
if (prefix) buffer.append("*** INFO *** "); |
805 |
buffer.append('+'); |
801 |
buffer.append(TTEST_MODERATION_MESSAGE); |
806 |
} |
802 |
buffer.append(" ("); |
807 |
buffer.append(PERCENT_FORMAT.format(deviation)); |
803 |
buffer.append(PERCENT_FORMAT.format(resultStats[2])); |
808 |
if (signal) { |
804 |
buffer.append(")"); |
809 |
buffer.append(" [±"); |
805 |
break; |
810 |
buffer.append(DOUBLE_FORMAT.format(resultStats[2]*100)); |
806 |
case TTEST|ERR: |
811 |
buffer.append(']'); |
807 |
buffer = new StringBuffer(); |
812 |
} |
808 |
if (prefix) buffer.append("*** WARNING *** "); |
|
|
809 |
buffer.append(TTEST_FAILURE_MESSAGE); |
810 |
break; |
811 |
default: |
812 |
return null; |
813 |
} |
813 |
} |
|
|
814 |
if (!full) buffer.append("</font>"); |
814 |
return buffer.toString(); |
815 |
return buffer.toString(); |
815 |
} |
816 |
} |
816 |
public static int confidenceLevel(double[] resultStats) { |
817 |
public static int confidenceLevel(double[] resultStats) { |
817 |
int level = OK; |
818 |
int level = OK; |
818 |
if (resultStats != null){ |
819 |
if (resultStats != null){ |
819 |
if (resultStats[1] >= 0 && resultStats[0] >= resultStats[1]) { // invalid t-test |
820 |
// if (resultStats[1] >= 0 && resultStats[0] >= resultStats[1]) { // invalid t-test |
820 |
level |= TTEST; |
821 |
// level |= TTEST; |
|
|
822 |
// } |
823 |
if (resultStats[2] > 0) { // signal standard error higher than 0% (only one iteration) |
824 |
level |= SIGN; |
821 |
} |
825 |
} |
822 |
if (resultStats[2] >= Utils.STANDARD_ERROR_THRESHOLD) { // standard error higher than the authorized threshold |
826 |
if (resultStats[2] >= Utils.STANDARD_ERROR_THRESHOLD) { // standard error higher than the authorized threshold |
823 |
level |= ERR; |
827 |
level |= ERR; |
Lines 857-900
Link Here
|
857 |
return name.equals(pattern); |
861 |
return name.equals(pattern); |
858 |
} |
862 |
} |
859 |
|
863 |
|
860 |
public static String getImage(int confidence, boolean hasExplanation) { |
864 |
public static String getImage(int confidence, double[] resultStats, boolean hasExplanation) { |
861 |
boolean scenarioFailed = (confidence & DEV) != 0; |
865 |
boolean scenarioFailed = (confidence & DEV) != 0; |
862 |
String image = null; |
866 |
String image = null; |
863 |
|
867 |
|
864 |
if (scenarioFailed) { |
868 |
if (scenarioFailed) { |
865 |
if (hasExplanation) { |
869 |
if (hasExplanation) { |
866 |
image = FAIL_IMAGE_EXPLAINED; |
870 |
image = FAIL_IMAGE_EXPLAINED; |
|
|
871 |
} else if ((confidence & ERR) != 0) { |
872 |
image = FAIL_IMAGE_WARN; |
867 |
} else { |
873 |
} else { |
868 |
switch (confidence) { |
874 |
image = FAIL_IMAGE; |
869 |
default: |
|
|
870 |
image = FAIL_IMAGE; |
871 |
break; |
872 |
case TTEST: |
873 |
image = FAIL_IMAGE_TTEST; |
874 |
break; |
875 |
case ERR: |
876 |
image = FAIL_IMAGE_ERR; |
877 |
break; |
878 |
case NOT_SIGNIFICANT: |
879 |
image = FAIL_IMAGE_WARN; |
880 |
break; |
881 |
} |
882 |
} |
875 |
} |
883 |
} else { |
876 |
} else if ((confidence & ERR) != 0) { |
884 |
switch (confidence) { |
877 |
image = OK_IMAGE_WARN; |
885 |
default: |
878 |
} else { |
886 |
image = OK_IMAGE; |
879 |
image = OK_IMAGE; |
887 |
break; |
|
|
888 |
case TTEST: |
889 |
image = OK_IMAGE_TTEST; |
890 |
break; |
891 |
case ERR: |
892 |
image = OK_IMAGE_ERR; |
893 |
break; |
894 |
case NOT_SIGNIFICANT: |
895 |
image = OK_IMAGE_WARN; |
896 |
break; |
897 |
} |
898 |
} |
880 |
} |
899 |
return image; |
881 |
return image; |
900 |
} |
882 |
} |