Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 113345 Details for
Bug 248251
[results] Names of generated perf results data files may be too long
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 20.37 KB, created by
Frederic Fusier
on 2008-09-24 06:34:13 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-09-24 06:34:13 EDT
Size:
20.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.test.performance >Index: src/org/eclipse/test/internal/performance/results/ScenarioResults.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/results/ScenarioResults.java,v >retrieving revision 1.2 >diff -u -r1.2 ScenarioResults.java >--- src/org/eclipse/test/internal/performance/results/ScenarioResults.java 23 Sep 2008 11:42:25 -0000 1.2 >+++ src/org/eclipse/test/internal/performance/results/ScenarioResults.java 24 Sep 2008 09:59:40 -0000 >@@ -92,7 +92,7 @@ > */ > public String getFileName() { > if (this.fileName == null) { >- this.fileName = this.name.replace('#', '.').replace(':', '_').replace('\\', '_'); >+ this.fileName = "Scenario" + this.id; //$NON-NLS-1$ > } > return this.fileName; > } >Index: src/org/eclipse/test/internal/performance/results/AbstractResults.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/results/AbstractResults.java,v >retrieving revision 1.5 >diff -u -r1.5 AbstractResults.java >--- src/org/eclipse/test/internal/performance/results/AbstractResults.java 23 Sep 2008 11:42:25 -0000 1.5 >+++ src/org/eclipse/test/internal/performance/results/AbstractResults.java 24 Sep 2008 09:59:40 -0000 >@@ -52,6 +52,13 @@ > }; > > /** >+ * The default dimension used to display results (typically in fingerprints). >+ * <p> >+ * Currently {@link InternalDimensions#ELAPSED_PROCESS} >+ */ >+ public static final Dim DEFAULT_DIM = SUPPORTED_DIMS[0]; >+ >+ /** > * The list of possible configurations. > * <p> > * Only used if no specific configurations are specified >Index: src/org/eclipse/test/internal/performance/data/Dim.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Dim.java,v >retrieving revision 1.8 >diff -u -r1.8 Dim.java >--- src/org/eclipse/test/internal/performance/data/Dim.java 23 Sep 2008 11:45:23 -0000 1.8 >+++ src/org/eclipse/test/internal/performance/data/Dim.java 24 Sep 2008 09:59:40 -0000 >@@ -24,6 +24,7 @@ > private final int fId; > private final Unit fUnit; > private final int fMultiplier; >+ private String shortName; > > public static Dim getDimension(int id) { > InternalDimensions.COMITTED.getId(); // trigger loading class InternalDimensions >@@ -69,6 +70,28 @@ > return DimensionMessages.getString(fId); > } > >+ /** >+ * Returns the short name for the current dimension. >+ * This short name is done keeping only uppercase characters from the name. >+ * It's typically used for anchor references based on dimension. >+ * >+ * @return The short name of the dimension >+ */ >+ public String getShortName() { >+ if (this.shortName == null) { >+ String name = getName(); >+ StringBuffer buffer = new StringBuffer(); >+ int length = name.length(); >+ for (int i=0; i<length; i++) { >+ if (Character.isUpperCase(name.charAt(i))) { >+ buffer.append(name.charAt(i)); >+ } >+ } >+ this.shortName = buffer.toString(); >+ } >+ return this.shortName; >+ } >+ > public String getDescription() { > return DimensionMessages.getString(fId); > } >#P org.eclipse.test.performance.ui >Index: src/org/eclipse/test/performance/ui/Utils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.releng.basebuilder/plugins/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java,v >retrieving revision 1.40 >diff -u -r1.40 Utils.java >--- src/org/eclipse/test/performance/ui/Utils.java 5 Nov 2007 14:53:26 -0000 1.40 >+++ src/org/eclipse/test/performance/ui/Utils.java 24 Sep 2008 09:59:41 -0000 >@@ -11,12 +11,6 @@ > package org.eclipse.test.performance.ui; > > import java.io.File; >-import java.io.FileInputStream; >-import java.io.FileNotFoundException; >-import java.io.FileOutputStream; >-import java.io.IOException; >-import java.io.InputStream; >-import java.io.OutputStream; > import java.text.DecimalFormat; > import java.text.NumberFormat; > import java.util.Arrays; >@@ -29,6 +23,7 @@ > import org.eclipse.swt.graphics.RGB; > import org.eclipse.test.internal.performance.PerformanceTestPlugin; > import org.eclipse.test.internal.performance.db.Variations; >+import org.eclipse.test.internal.performance.results.AbstractResults; > > > public class Utils { >@@ -102,41 +97,23 @@ > } > > /** >- * Utility method to copy a file. >- * >- * @param src the source file. >- * @param dest the destination. >+ * Copy all image files. > */ >- private static void copyFile(File src, File dest) { >- >- try { >- InputStream in = new FileInputStream(src); >- OutputStream out = new FileOutputStream(dest); >- byte[] buf = new byte[1024]; >- int len; >- while ((len = in.read(buf)) > 0) { >- out.write(buf, 0, len); >- } >- in.close(); >- out.close(); >- >- } catch (FileNotFoundException e) { >- e.printStackTrace(); >- } catch (IOException e) { >- e.printStackTrace(); >- } >- } > public static void copyImages(File images, File output) { >- copyFile(new File(images, FAIL_IMAGE), new File(output, FAIL_IMAGE)); >- copyFile(new File(images, FAIL_IMAGE_EXPLAINED), new File(output, FAIL_IMAGE_EXPLAINED)); >- copyFile(new File(images, FAIL_IMAGE_WARN), new File(output, FAIL_IMAGE_WARN)); >- copyFile(new File(images, OK_IMAGE), new File(output, OK_IMAGE)); >- copyFile(new File(images, OK_IMAGE_WARN), new File(output, OK_IMAGE_WARN)); >- copyFile(new File(images, UNKNOWN_IMAGE), new File(output, UNKNOWN_IMAGE)); >+ AbstractResults.copyFile(new File(images, FAIL_IMAGE), new File(output, FAIL_IMAGE)); >+ AbstractResults.copyFile(new File(images, FAIL_IMAGE_EXPLAINED), new File(output, FAIL_IMAGE_EXPLAINED)); >+ AbstractResults.copyFile(new File(images, FAIL_IMAGE_WARN), new File(output, FAIL_IMAGE_WARN)); >+ AbstractResults.copyFile(new File(images, OK_IMAGE), new File(output, OK_IMAGE)); >+ AbstractResults.copyFile(new File(images, OK_IMAGE_WARN), new File(output, OK_IMAGE_WARN)); >+ AbstractResults.copyFile(new File(images, UNKNOWN_IMAGE), new File(output, UNKNOWN_IMAGE)); > } >+ >+ /** >+ * Copy all scripts files. >+ */ > public static void copyScripts(File scripts, File output) { >- copyFile(new File(scripts, "ToolTip.css"), new File(output, "ToolTip.css")); >- copyFile(new File(scripts, "ToolTip.js"), new File(output, "ToolTip.js")); >+ AbstractResults.copyFile(new File(scripts, "ToolTip.css"), new File(output, "ToolTip.css")); >+ AbstractResults.copyFile(new File(scripts, "ToolTip.js"), new File(output, "ToolTip.js")); > } > > /** >Index: src/org/eclipse/test/performance/ui/FingerPrint.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.releng.basebuilder/plugins/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java,v >retrieving revision 1.26 >diff -u -r1.26 FingerPrint.java >--- src/org/eclipse/test/performance/ui/FingerPrint.java 5 Nov 2007 14:53:26 -0000 1.26 >+++ src/org/eclipse/test/performance/ui/FingerPrint.java 24 Sep 2008 09:59:41 -0000 >@@ -89,6 +89,7 @@ > // Create BarGraph > // BarGraph barGraph = new BarGraph(null); > BarGraph barGraph = null; >+ String defaultDimName = AbstractResults.DEFAULT_DIM.getName(); > for (int i=0, size=scenarios.size(); i<size; i++) { > ScenarioResults scenarioResults = (ScenarioResults) scenarios.get(i); > ConfigResults configResults = scenarioResults.getConfigResults(configName); >@@ -96,8 +97,7 @@ > double[] results = configResults.getCurrentBuildDeviation(); > double percent = -results[0] * 100.0; > if (results != null && Math.abs(percent) < 200) { >- String defaultDimensionName = AbstractResults.SUPPORTED_DIMS[0].getName(); >- String name = scenarioResults.getLabel() + " (" + defaultDimensionName + ")"; >+ String name = scenarioResults.getLabel() + " (" + defaultDimName + ")"; > if (!configResults.getCurrentBuildName().equals(buildName)) { > continue; // the test didn't run on last build, skip it > } >@@ -109,7 +109,7 @@ > } > barGraph.addItem(name, > results, >- configName + "/" + scenarioResults.getFileName() + ".html#" + defaultDimensionName, >+ configName + "/" + scenarioResults.getFileName() + ".html", > configResults.getCurrentBuildResults().getComment(), > (Utils.confidenceLevel(results) & Utils.ERR) == 0); > } >Index: src/org/eclipse/test/performance/ui/ScenarioData.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.releng.basebuilder/plugins/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java,v >retrieving revision 1.5 >diff -u -r1.5 ScenarioData.java >--- src/org/eclipse/test/performance/ui/ScenarioData.java 23 Sep 2008 11:45:22 -0000 1.5 >+++ src/org/eclipse/test/performance/ui/ScenarioData.java 24 Sep 2008 09:59:41 -0000 >@@ -30,7 +30,6 @@ > import org.eclipse.swt.graphics.ImageLoader; > import org.eclipse.swt.widgets.Display; > import org.eclipse.test.internal.performance.data.Dim; >-import org.eclipse.test.internal.performance.data.DimensionMessages; > import org.eclipse.test.internal.performance.results.AbstractResults; > import org.eclipse.test.internal.performance.results.BuildResults; > import org.eclipse.test.internal.performance.results.ComponentResults; >@@ -66,6 +65,85 @@ > this.rootDir = outputDir; > } > >+/* >+ * Create a file handle verifying that its name does not go over >+ * the maximum authorized length. >+ */ >+private File createFile(File outputDir, String subdir, String name, String extension) { >+ File dir = outputDir; >+ if (subdir != null) { >+ dir = new File(outputDir, subdir); >+ if (!dir.exists()) { >+ dir.mkdir(); >+ } >+ } >+ return new File(dir, name + '.' + extension); >+} >+ >+/* >+ * Returns a LineGraph object representing measurements for a scenario over builds. >+ */ >+private TimeLineGraph getLineGraph(ScenarioResults scenarioResults, ConfigResults configResults, Dim dim, List highlightedPoints, List currentBuildIdPrefixes) { >+ Display display = Display.getDefault(); >+ >+ Color black = display.getSystemColor(SWT.COLOR_BLACK); >+ Color yellow = display.getSystemColor(SWT.COLOR_DARK_YELLOW); >+ Color magenta = display.getSystemColor(SWT.COLOR_MAGENTA); >+ >+ String scenarioName = scenarioResults.getName(); >+ TimeLineGraph graph = new TimeLineGraph(scenarioName + ": " + dim.getName(), dim); >+ String baseline = configResults.getBaselineBuildName(); >+ String current = configResults.getCurrentBuildName(); >+ >+ Iterator builds = configResults.getResults(); >+ List lastSevenNightlyBuilds = configResults.lastNightlyBuildNames(7); >+ buildLoop: while (builds.hasNext()) { >+ BuildResults buildResults = (BuildResults) builds.next(); >+ String buildID = buildResults.getName(); >+ int underscoreIndex = buildID.indexOf('_'); >+ String label = (underscoreIndex != -1 && (buildID.equals(baseline) || buildID.equals(current))) ? buildID.substring(0, underscoreIndex) : buildID; >+ >+ double value = buildResults.getValue(dim.getId()); >+ >+ if (buildID.equals(current)) { >+ Color color = black; >+ if (buildID.startsWith("N")) >+ color = yellow; >+ >+ graph.addItem("main", label, dim.getDisplayValue(value), value, color, true, Utils.getDateFromBuildID(buildID), true); >+ continue; >+ } >+ if (highlightedPoints.contains(buildID)) { >+ graph.addItem("main", label, dim.getDisplayValue(value), value, black, false, Utils.getDateFromBuildID(buildID, false), true); >+ continue; >+ } >+ if (buildID.charAt(0) == 'N') { >+ if (lastSevenNightlyBuilds.contains(buildID)) { >+ graph.addItem("main", buildID, dim.getDisplayValue(value), value, yellow, false, Utils.getDateFromBuildID(buildID), false); >+ } >+ continue; >+ } >+ for (int i=0;i<currentBuildIdPrefixes.size();i++){ >+ if (buildID.startsWith(currentBuildIdPrefixes.get(i).toString())) { >+ graph.addItem("main", buildID, dim.getDisplayValue(value), value, black, false, Utils.getDateFromBuildID(buildID), false); >+ continue buildLoop; >+ } >+ } >+ if (buildID.equals(baseline)) { >+ boolean drawBaseline = (baselinePrefix != null) ? false : true; >+ graph.addItem("reference", label, dim.getDisplayValue(value), value, magenta, true, Utils.getDateFromBuildID(buildID, true), true, drawBaseline); >+ continue; >+ } >+ if (baselinePrefix != null) { >+ if (buildID.startsWith(baselinePrefix) && !buildID.equals(baseline) && Utils.getDateFromBuildID(buildID, true) <= Utils.getDateFromBuildID(baseline, true)) { >+ graph.addItem("reference", label, dim.getDisplayValue(value), value, magenta, false, Utils.getDateFromBuildID(buildID, true), false); >+ continue; >+ } >+ } >+ } >+ return graph; >+} >+ > /** > * Print the scenario all builds data from the given performance results. > * >@@ -123,12 +201,12 @@ > } > > String scenarioFileName = scenarioResults.getFileName(); >- File outFile = new File(outputDir, scenarioFileName + ".html"); >+ File outputFile = new File(outputDir, scenarioFileName+".html"); > PrintStream stream = null; > try { >- stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outFile))); >+ stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outputFile))); > } catch (FileNotFoundException e) { >- System.err.println("can't create output file" + outFile); //$NON-NLS-1$ >+ System.err.println("can't create output file" + outputFile); //$NON-NLS-1$ > } > if (stream == null) { > stream = System.out; >@@ -152,7 +230,7 @@ > } > > // Print link to raw data. >- String rawDataFile = scenarioFileName+"_raw.html"; >+ String rawDataFile = "raw/" + scenarioFileName+".html"; > stream.println("<br><br><b><a href=\""+rawDataFile+"\">Raw data and Stats</a></b><br><br>\n"); > stream.println("<b>Click measurement name to view line graph of measured values over builds.</b><br><br>\n"); > >@@ -163,8 +241,7 @@ > Dim[] dimensions = AbstractResults.SUPPORTED_DIMS; > int dimLength = dimensions.length; > for (int d=0; d<dimLength; d++) { >- String dimName = dimensions[d].getName(); >- stream.print("<td><a href=\"#" + configName + "_" + scenarioFileName + "_" + dimName + "\"><b>" + dimName + "</b></a></td>"); >+ stream.print("<td><a href=\"#" + dimensions[d].getShortName() + "\"><b>" + dimensions[d].getName() + "</b></a></td>"); > } > stream.println("</tr>\n"); > >@@ -187,17 +264,15 @@ > > // print image maps of historical > for (int d=0; d<dimLength; d++) { >- String dimName = dimensions[d].getName(); >- int dim_id = dimensions[d].getId(); > TimeLineGraph lineGraph = getLineGraph(scenarioResults, configResults, dimensions[d], highlightedPoints, this.buildIDStreamPatterns); > >- File graphsDir = new File(outputDir, "graphs"); >- graphsDir.mkdir(); >- File imgFile = new File(graphsDir, scenarioFileName + "_" + dimName + ".gif"); >+ String dimShortName = dimensions[d].getShortName(); >+ String imgFileName = scenarioFileName + "_" + dimShortName; >+ File imgFile = createFile(outputDir, "graphs", imgFileName, "gif"); > saveGraph(lineGraph, imgFile); >- stream.println("<br><a name=\"" + configName + "_" + scenarioFileName + "_" + dimName + "\"></a>"); >- stream.println("<br><b>" + dimName + "</b><br>"); >- stream.println(DimensionMessages.getDescription(dim_id) + "<br><br>\n"); >+ stream.println("<br><a name=\"" + dimShortName + "\"></a>"); >+ stream.println("<br><b>" + dimensions[d].getName() + "</b><br>"); >+ stream.println(dimensions[d].getDescription() + "<br><br>\n"); > stream.print("<img src=\"graphs/"); > stream.print(imgFile.getName()); > stream.print("\" usemap=\"#" + lineGraph.fTitle + "\">"); >@@ -285,70 +360,6 @@ > } > > /* >- * Returns a LineGraph object representing measurements for a scenario over builds. >- */ >-private TimeLineGraph getLineGraph(ScenarioResults scenarioResults, ConfigResults configResults, Dim dim, List highlightedPoints, List currentBuildIdPrefixes) { >- Display display = Display.getDefault(); >- >- Color black = display.getSystemColor(SWT.COLOR_BLACK); >- Color yellow = display.getSystemColor(SWT.COLOR_DARK_YELLOW); >- Color magenta = display.getSystemColor(SWT.COLOR_MAGENTA); >- >- String scenarioName = scenarioResults.getName(); >- TimeLineGraph graph = new TimeLineGraph(scenarioName + ": " + dim.getName(), dim); >- String baseline = configResults.getBaselineBuildName(); >- String current = configResults.getCurrentBuildName(); >- >- Iterator builds = configResults.getResults(); >- List lastSevenNightlyBuilds = configResults.lastNightlyBuildNames(7); >- buildLoop: while (builds.hasNext()) { >- BuildResults buildResults = (BuildResults) builds.next(); >- String buildID = buildResults.getName(); >- int underscoreIndex = buildID.indexOf('_'); >- String label = (underscoreIndex != -1 && (buildID.equals(baseline) || buildID.equals(current))) ? buildID.substring(0, underscoreIndex) : buildID; >- >- double value = buildResults.getValue(dim.getId()); >- >- if (buildID.equals(current)) { >- Color color = black; >- if (buildID.startsWith("N")) >- color = yellow; >- >- graph.addItem("main", label, dim.getDisplayValue(value), value, color, true, Utils.getDateFromBuildID(buildID), true); >- continue; >- } >- if (highlightedPoints.contains(buildID)) { >- graph.addItem("main", label, dim.getDisplayValue(value), value, black, false, Utils.getDateFromBuildID(buildID, false), true); >- continue; >- } >- if (buildID.charAt(0) == 'N') { >- if (lastSevenNightlyBuilds.contains(buildID)) { >- graph.addItem("main", buildID, dim.getDisplayValue(value), value, yellow, false, Utils.getDateFromBuildID(buildID), false); >- } >- continue; >- } >- for (int i=0;i<currentBuildIdPrefixes.size();i++){ >- if (buildID.startsWith(currentBuildIdPrefixes.get(i).toString())) { >- graph.addItem("main", buildID, dim.getDisplayValue(value), value, black, false, Utils.getDateFromBuildID(buildID), false); >- continue buildLoop; >- } >- } >- if (buildID.equals(baseline)) { >- boolean drawBaseline = (baselinePrefix != null) ? false : true; >- graph.addItem("reference", label, dim.getDisplayValue(value), value, magenta, true, Utils.getDateFromBuildID(buildID, true), true, drawBaseline); >- continue; >- } >- if (baselinePrefix != null) { >- if (buildID.startsWith(baselinePrefix) && !buildID.equals(baseline) && Utils.getDateFromBuildID(buildID, true) <= Utils.getDateFromBuildID(baseline, true)) { >- graph.addItem("reference", label, dim.getDisplayValue(value), value, magenta, false, Utils.getDateFromBuildID(buildID, true), false); >- continue; >- } >- } >- } >- return graph; >-} >- >-/* > * Print details file of the scenario builds data. > */ > private void printDetails(String configName, String configBox, ComponentResults componentResults, File outputDir) { >@@ -359,12 +370,12 @@ > if (configResults == null || !configResults.isValid()) continue; > String scenarioName= scenarioResults.getName(); > String scenarioFileName = scenarioResults.getFileName(); >- File outFile = new File(outputDir, scenarioFileName + "_raw.html"); >+ File outputFile = createFile(outputDir, "raw", scenarioFileName, "html"); > PrintStream stream = null; > try { >- stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outFile))); >+ stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outputFile))); > } catch (FileNotFoundException e) { >- System.err.println("can't create output file" + outFile); //$NON-NLS-1$ >+ System.err.println("can't create output file" + outputFile); //$NON-NLS-1$ > } > if (stream == null) stream = System.out; > RawDataTable currentResultsTable = new RawDataTable(configResults, this.buildIDStreamPatterns, stream); >@@ -373,7 +384,7 @@ > stream.println(Utils.HTML_DEFAULT_CSS); > stream.println("<title>" + scenarioName + "(" + configBox + ")" + " - Details</title></head>"); //$NON-NLS-1$ > stream.println("<h4>Scenario: " + scenarioName + " (" + configBox + ")</h4>"); //$NON-NLS-1$ >- stream.println("<a href=\""+scenarioFileName+".html\">VIEW GRAPH</a><br><br>"); //$NON-NLS-1$ >+ stream.println("<a href=\"../"+scenarioFileName+".html\">VIEW GRAPH</a><br><br>"); //$NON-NLS-1$ > stream.println("<table><td><b>Current Stream Test Runs</b></td><td><b>Baseline Test Runs</b></td></tr>\n"); > stream.println("<tr valign=\"top\">"); > stream.print("<td>");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248251
: 113345