Times are given in milliseconds.
" + EOL; + htmlString = htmlString + "Class | " + EOL;
+ htmlString = htmlString + "Name | " + EOL;
+ htmlString = htmlString + "Elapsed Process (Current) | " + EOL;
+ htmlString = htmlString + "Elapsed Process (Baseline) | " + EOL;
+ htmlString = htmlString + "Difference | " + EOL;
+ htmlString = htmlString + "CPU Time (Current) | " + EOL;
+ htmlString = htmlString + "CPU Time (Baseline)" + EOL; + htmlString = htmlString + " | Difference" + EOL; + + for (String scenario : scenarioList) { + String[] scenarioParts = null; + String componentClass = null; + String componentName = null; + //swt is different + if (scenario.contains("swt")) { + scenarioParts = scenario.split("\\."); + componentName = scenarioParts[scenarioParts.length - 1]; + for (int i=0; i < (scenarioParts.length - 1); i++ ) { + componentClass = componentClass + scenarioParts[i] + "."; + } + //trim final . + componentClass = componentClass.substring(0, componentClass.length()-1); + } else { + scenarioParts = scenario.split("#"); + componentClass = scenarioParts[0]; + componentName = scenarioParts[1]; + } + + double[] currentData = results.getData("current", scenario); + String elapsedCurrent = String.valueOf(currentData[0]); + String cpuCurrent = String.valueOf(currentData[1]); + + String elapsedBaseline = "N/A"; + String cpuBaseline = "N/A"; + + String elapsedPercent = "N/A"; + String cpuPercent = "N/A"; + + String elapsedColor = "#4CE600"; + String cpuColor = "#4CE600"; + + if (baselineScenarios.contains(scenario)) { + double[] baselineData = results.getData("baseline", scenario); + + elapsedBaseline = String.valueOf(baselineData[0]); + cpuBaseline = String.valueOf(baselineData[1]); + + double elapsedDifference = baselineData[0] - currentData[0]; + double cpuDifference = baselineData[1] - currentData[1]; + + double elapsedPercentValue = Math.abs(elapsedDifference / baselineData[0]) * 100; + double cpuPercentValue = Math.abs(cpuDifference / baselineData[1]) * 100; + + elapsedPercent = String.format("%.2f", elapsedPercentValue) + "%"; + cpuPercent = String.format("%.2f", cpuPercentValue) + "%"; + + if (elapsedDifference < 0) { + elapsedColor = "D7191C"; + } + if (cpuDifference < 0) { + cpuColor = "D7191C"; + } + + } + + htmlString = htmlString + " |
" + componentClass + EOL; + htmlString = htmlString + " | " + componentName + EOL; + htmlString = htmlString + " | " + elapsedCurrent + EOL; + htmlString = htmlString + " | " + elapsedBaseline + EOL; + htmlString = htmlString + " | " + elapsedPercent + EOL; + htmlString = htmlString + " | " + cpuCurrent + EOL; + htmlString = htmlString + " | " + cpuBaseline + EOL; + htmlString = htmlString + " | " + cpuPercent + EOL; + } + + htmlString = htmlString + " |