This commit was manufactured by cvs2svn to create tag 'v20090901'.
Sprout from master 2009-09-01 11:05:06 UTC ffusier 'HEAD - 288234'
Cherrypick from master 2009-07-31 15:29:50 UTC ffusier 'HEAD - 285293':
bundles/org.eclipse.test.performance.ui/.classpath
bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
bundles/org.eclipse.test.performance.ui/build.properties
bundles/org.eclipse.test.performance.ui/performanceui.jar
bundles/org.eclipse.test.performance.ui/plugin.xml
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/BarGraph.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrintGraph.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/LineGraph.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/RawDataTable.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioStatusTable.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraph.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraphItem.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/UiPlugin.java
bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
diff --git a/bundles/org.eclipse.test.performance.ui/.classpath b/bundles/org.eclipse.test.performance.ui/.classpath
index 4c3abc5..b091d88 100644
--- a/bundles/org.eclipse.test.performance.ui/.classpath
+++ b/bundles/org.eclipse.test.performance.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="output" path="src"/>
</classpath>
diff --git a/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
index 5e4bc08..90da67c 100644
--- a/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.test.performance.ui/META-INF/MANIFEST.MF
@@ -2,29 +2,17 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.test.performance.ui; singleton:=true
-Bundle-Version: 3.6.0.qualifier
+Bundle-Version: 1.0.100.qualifier
Bundle-ClassPath: performanceui.jar
Bundle-Activator: org.eclipse.test.performance.ui.UiPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.test.performance,
org.eclipse.swt,
org.apache.derby;resolution:=optional,
Cloudscape;resolution:=optional,
- org.eclipse.test.performance.derby;bundle-version="10.4.2";resolution:=optional,
- org.junit,
- org.eclipse.ui;bundle-version="3.5.0",
- org.eclipse.ui.views;bundle-version="3.4.0",
- org.eclipse.jface.text;bundle-version="3.5.100",
- org.eclipse.ui.ide,
- org.eclipse.core.resources;bundle-version="3.5.100",
- org.eclipse.test.performance;bundle-version="3.6.0",
- org.eclipse.ui.console,
- org.eclipse.jdt.ui
+ org.junit
Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Export-Package: org.eclipse.test.internal.performance.results.db,
- org.eclipse.test.internal.performance.results.model,
- org.eclipse.test.internal.performance.results.ui,
- org.eclipse.test.internal.performance.results.utils,
- org.eclipse.test.performance.ui
+Export-Package: org.eclipse.test.performance.ui
diff --git a/bundles/org.eclipse.test.performance.ui/build.properties b/bundles/org.eclipse.test.performance.ui/build.properties
index 6277598..2030d36 100644
--- a/bundles/org.eclipse.test.performance.ui/build.properties
+++ b/bundles/org.eclipse.test.performance.ui/build.properties
@@ -15,8 +15,6 @@
images/,\
plugin.xml,\
readme.html,\
- scripts/,\
- icons/
+ scripts/
source.performanceui.jar = src/
jars.compile.order = performanceui.jar
-src.includes = src/
diff --git a/bundles/org.eclipse.test.performance.ui/performanceui.jar b/bundles/org.eclipse.test.performance.ui/performanceui.jar
index 1322b1f..6d3ad0d 100644
--- a/bundles/org.eclipse.test.performance.ui/performanceui.jar
+++ b/bundles/org.eclipse.test.performance.ui/performanceui.jar
Binary files differ
diff --git a/bundles/org.eclipse.test.performance.ui/plugin.xml b/bundles/org.eclipse.test.performance.ui/plugin.xml
index 885b2b7..d3e20a7 100644
--- a/bundles/org.eclipse.test.performance.ui/plugin.xml
+++ b/bundles/org.eclipse.test.performance.ui/plugin.xml
@@ -12,60 +12,4 @@
</run>
</application>
</extension>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- class="org.eclipse.test.internal.performance.results.ui.PerformanceResultsPreferencePage"
- id="org.eclipse.test.performance.ui.prpp"
- name="Performances">
- </page>
- </extension>
-
- <extension
- point="org.eclipse.ui.views">
- <category
- name="Performances"
- id="Performances">
- </category>
- <view
- category="Performances"
- class="org.eclipse.test.internal.performance.results.ui.ComponentsView"
- icon="icons/components.gif"
- id="org.eclipse.test.internal.performance.results.ui.ComponentsView"
- name="Components">
- </view>
- <view
- category="Performances"
- class="org.eclipse.test.internal.performance.results.ui.BuildsView"
- icon="icons/builds.gif"
- id="org.eclipse.test.internal.performance.results.ui.BuildsView"
- name="Builds">
- </view>
- <view
- category="Performances"
- class="org.eclipse.test.internal.performance.results.ui.ComponentResultsView"
- icon="icons/results.gif"
- id="org.eclipse.test.internal.performance.results.ui.ComponentsResultsView"
- name="Component Results"
- restorable="true">
- </view>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.test.internal.performance.results.ui.PerformanceResultsPreferenceInitializer">
- </initializer>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- class="org.eclipse.test.internal.performance.results.ui.PerformanceResultsPerspective"
- icon="icons/perfs.gif"
- id="org.eclipse.test.performance.ui.perspectives.PerformanceResultsPerspective"
- name="Performances">
- <description>
- Perspective to survey the performances of the Eclipse components
- </description>
- </perspective>
- </extension>
-</plugin>
+</plugin>
\ No newline at end of file
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/BarGraph.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/BarGraph.java
index 438909c..546551e 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/BarGraph.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/BarGraph.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@
private static final int GAP= 10; // gap between bars
private static final int TGAP= 5; // gap between lines and labels
- private static final boolean NO_SCALE= true; //
+ private static final boolean NO_SCALE= true; //
// if NO_SCALE is true the following values are used:
private static final double RATIO= 0.6; // fraction of width reserved for bar graph; needs tweaking
@@ -40,17 +40,18 @@
private static class BarItem {
String title;
- double value;
+ double value, error;
String url;
String slowdownExpected;
boolean significant;
BarItem(String t, double[] stats, String u, String slow, boolean sig) {
- this.title= t;
- this.value= stats[0]==0 ? 0 : -stats[0] * 100;
- this.url= u;
- this.slowdownExpected= slow;
- this.significant= sig;
+ title= t;
+ value= stats[0]==0 ? 0 : -stats[0] * 100;
+ error = stats[1] * 100;
+ url= u;
+ slowdownExpected= slow;
+ significant= sig;
}
}
@@ -58,19 +59,19 @@
private List fItems;
BarGraph(String title) {
- this.fTitle= title;
- this.fItems= new ArrayList();
+ fTitle= title;
+ fItems= new ArrayList();
}
public void addItem(String name, double[] stats, String url, String slow, boolean significant) {
- this.fItems.add(new BarItem(name, stats, url, slow, significant));
+ fItems.add(new BarItem(name, stats, url, slow, significant));
}
public int getHeight() {
- int n= this.fItems.size();
+ int n= fItems.size();
int textHeight= 16;
int titleHeight= 0;
- if (this.fTitle != null)
+ if (fTitle != null)
titleHeight= textHeight + GAP;
return MARGIN + titleHeight + n * (GAP + BARHEIGHT) + GAP + textHeight + MARGIN;
}
@@ -79,7 +80,7 @@
NumberFormat nf= NumberFormat.getInstance();
- BarItem[] bars= (BarItem[]) this.fItems.toArray(new BarItem[this.fItems.size()]);
+ BarItem[] bars= (BarItem[]) fItems.toArray(new BarItem[fItems.size()]);
// draw white background
Color bg= display.getSystemColor(SWT.COLOR_WHITE);
@@ -104,9 +105,9 @@
Color fg= display.getSystemColor(SWT.COLOR_BLACK);
int vstart= 0; // start rows here
- if (this.fTitle != null) {
- vstart= gc.stringExtent(this.fTitle).y + GAP;
- gc.drawString(this.fTitle, MARGIN, MARGIN, true); // draw title left aligned
+ if (fTitle != null) {
+ vstart= gc.stringExtent(fTitle).y + GAP;
+ gc.drawString(fTitle, MARGIN, MARGIN, true); // draw title left aligned
}
int center= MARGIN + w / 2;
@@ -191,7 +192,7 @@
BarItem bar= bars[i];
double delta = bar.value;
double orgDelta= delta;
-
+
boolean clamped= false;
if (NO_SCALE) {
if (delta > max) {
@@ -272,9 +273,9 @@
y+= BARHEIGHT + GAP;
if (hasURL) {
- if (this.fAreaBuffer == null)
- this.fAreaBuffer= new StringBuffer();
- this.fAreaBuffer.append(" echo '<area shape=\"RECT\" coords=\"0," + y0 + ',' + width + ',' + y + "\" href=\"" + bar.url + "\">';\n");
+ if (fAreaBuffer == null)
+ fAreaBuffer= new StringBuffer();
+ fAreaBuffer.append(" echo '<area shape=\"RECT\" coords=\"0," + y0 + ',' + width + ',' + y + "\" href=\"" + bar.url + "\">';\n");
}
}
@@ -284,9 +285,9 @@
}
public String getAreas() {
- if (this.fAreaBuffer != null) {
- String s= this.fAreaBuffer.toString();
- this.fAreaBuffer= null;
+ if (fAreaBuffer != null) {
+ String s= fAreaBuffer.toString();
+ fAreaBuffer= null;
return s;
}
return null;
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
index 52e9321..13bb2e1 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,10 +26,10 @@
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.test.internal.performance.results.db.ConfigResults;
-import org.eclipse.test.internal.performance.results.db.DB_Results;
-import org.eclipse.test.internal.performance.results.db.PerformanceResults;
-import org.eclipse.test.internal.performance.results.db.ScenarioResults;
+import org.eclipse.test.internal.performance.results.AbstractResults;
+import org.eclipse.test.internal.performance.results.ConfigResults;
+import org.eclipse.test.internal.performance.results.PerformanceResults;
+import org.eclipse.test.internal.performance.results.ScenarioResults;
/**
* Class used to create scenario fingerprint.
@@ -50,12 +50,12 @@
/**
* Create and save fingerprints as image and print their reference in the current stream.
- *
+ *
* @param performanceResults The performance results used to print the fingerprints
*/
public void print(final PerformanceResults performanceResults) {
String buildName = performanceResults.getName();
-
+
// Compute fingerprint output file name prefix
int currentUnderscoreIndex = buildName.indexOf('_');
if (currentUnderscoreIndex != -1){
@@ -66,17 +66,17 @@
buffer.append(this.component);
buffer.append('_');
}
- buffer.append(DB_Results.getDbBaselineRefVersion());
+ buffer.append(AbstractResults.VERSION_REF);
buffer.append('_');
buffer.append(buildName);
String filePrefix = buffer.toString();
-
+
// Print the legend
this.stream.print("The following fingerprints show results for the most representative tests of the ");
if (this.component == null) {
this.stream.print("current build.<br>\n");
} else {
- this.stream.print(this.component);
+ this.stream.print(component);
this.stream.print(" component.<br>\n");
}
this.stream.print("<table border=\"0\">\n");
@@ -114,7 +114,7 @@
// TODO use FingerPrintGraph instead
BarGraph barGraph = null;
List allResults = new ArrayList();
- String defaultDimName = DB_Results.getDefaultDimension().getName();
+ 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);
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrintGraph.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrintGraph.java
index 7fec6d6..64ebf9d 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrintGraph.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/FingerPrintGraph.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,17 +30,19 @@
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Resource;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.test.internal.performance.results.db.BuildResults;
-import org.eclipse.test.internal.performance.results.db.ConfigResults;
-import org.eclipse.test.internal.performance.results.db.DB_Results;
-import org.eclipse.test.internal.performance.results.db.ScenarioResults;
-import org.eclipse.test.internal.performance.results.utils.Util;
+import org.eclipse.test.internal.performance.results.AbstractResults;
+import org.eclipse.test.internal.performance.results.BuildResults;
+import org.eclipse.test.internal.performance.results.ConfigResults;
+import org.eclipse.test.internal.performance.results.ScenarioResults;
/**
* Abstract class to build graph with bars
*/
public class FingerPrintGraph {
+ // Dimensions
+ static final String DEFAULT_DIM_NAME = AbstractResults.DEFAULT_DIM.getName();
+
// Sizes
static final int MARGIN= 5; // margin on all four sides
static final int BAR_HEIGHT= 6; // height of bar
@@ -96,11 +98,10 @@
// Values
double maxValue = 0.0;
double minValue = Double.MAX_VALUE;
-
+
// File info
File outputDir;
String imageName;
- private final String defaultDimName = DB_Results.getDefaultDimension().getName();
/*
* Member class defining a bar graph area.
@@ -253,7 +254,7 @@
this.gc.fillRectangle(MARGIN, y + (GAP/2), baselineBarLength, BAR_HEIGHT);
Rectangle rec = new Rectangle(MARGIN, y + (GAP/2), baselineBarLength, BAR_HEIGHT);
this.gc.drawRectangle(rec);
- graphArea.addArea(rec, "Time for baseline build "+baselineBuildResults.getName()+": "+Util.timeString((long)baselineValue));
+ graphArea.addArea(rec, "Time for baseline build "+baselineBuildResults.getName()+": "+AbstractResults.timeString((long)baselineValue));
} else {
int wr = baselineBarLength - baselineErrorLength;
Rectangle recValue = new Rectangle(MARGIN, y + (GAP/2), wr, BAR_HEIGHT);
@@ -266,9 +267,9 @@
StringBuffer tooltip = new StringBuffer("Time for baseline build ");
tooltip.append(baselineBuildResults.getName());
tooltip.append(": ");
- tooltip.append(Util.timeString((long)baselineValue));
+ tooltip.append(AbstractResults.timeString((long)baselineValue));
tooltip.append(" [±");
- tooltip.append(Util.timeString((long)baselineError));
+ tooltip.append(AbstractResults.timeString((long)baselineError));
tooltip.append(']');
graphArea.addArea(rec, tooltip.toString());
labelxpos += baselineErrorLength;
@@ -293,7 +294,7 @@
this.gc.fillRectangle(MARGIN, y + (GAP/2) + BAR_HEIGHT, currentBarLength, BAR_HEIGHT);
Rectangle rec = new Rectangle(MARGIN, y + (GAP/2) + BAR_HEIGHT, currentBarLength, BAR_HEIGHT);
this.gc.drawRectangle(rec);
- String tooltip = "Time for current build "+currentBuildResults.getName()+": "+Util.timeString((long)currentValue);
+ String tooltip = "Time for current build "+currentBuildResults.getName()+": "+AbstractResults.timeString((long)currentValue);
if (isCommented) {
tooltip += ". " + currentBuildResults.getComment();
}
@@ -313,9 +314,9 @@
StringBuffer tooltip = new StringBuffer("Time for current build ");
tooltip.append(currentBuildResults.getName());
tooltip.append(": ");
- tooltip.append(Util.timeString((long)currentValue));
+ tooltip.append(AbstractResults.timeString((long)currentValue));
tooltip.append(" [±");
- tooltip.append(Util.timeString((long)currentError));
+ tooltip.append(AbstractResults.timeString((long)currentError));
tooltip.append(']');
if (isCommented) {
tooltip.append(". ");
@@ -384,7 +385,7 @@
// draw scenario title
int x= titleStart;
ScenarioResults scenarioResults = (ScenarioResults) configResults.getParent();
- String title = scenarioResults.getLabel() + " (" + this.defaultDimName + ")";
+ String title = scenarioResults.getLabel() + " (" + DEFAULT_DIM_NAME + ")";
Point e= this.gc.stringExtent(title);
this.gc.drawLine(x, labelvpos + e.y - 1, x + e.x, labelvpos + e.y - 1);
this.gc.drawString(title, x, labelvpos, true);
@@ -442,7 +443,7 @@
// draw value
this.gc.setForeground(BLACK);
- String val= Util.timeString(value);
+ String val= AbstractResults.timeString(value);
Point point= this.gc.stringExtent(val);
this.gc.drawString(val, x - point.x / 2, this.graphHeight + TGAP, true);
@@ -475,7 +476,7 @@
// draw value
this.gc.setForeground(BLACK);
- String str = Util.timeString(value);
+ String str = AbstractResults.timeString(value);
Point point= this.gc.stringExtent(str);
this.gc.drawString(str, x - point.x / 2, this.graphHeight + TGAP, true);
@@ -604,7 +605,7 @@
// Draw the bars
drawBars(kind);
-
+
// Dispose
this.gc.dispose();
}
@@ -612,11 +613,11 @@
/**
* Create, paint and save all supported bar graphs and add the corresponding
* image and map references in the given stream.
- *
+ *
* @param stream
*/
final public void paint(PrintStream stream) {
-
+
// Paint supported graphs
int length = SUPPORTED_GRAPHS.length;
for (int i=0; i<length; i++) {
@@ -663,7 +664,7 @@
print(kind, stream);
} else {
stream.print("<br><br>There is no fingerprint for ");
- stream.print(this.imageName);
+ stream.print(imageName);
stream.print(" (kind=");
stream.print(kind);
stream.print(")<br><br>\n");
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
index 8c6ea9e..07967e3 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/GenerateResults.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,17 +31,17 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.test.internal.performance.results.db.ConfigResults;
-import org.eclipse.test.internal.performance.results.db.DB_Results;
-import org.eclipse.test.internal.performance.results.db.PerformanceResults;
-import org.eclipse.test.internal.performance.results.db.ScenarioResults;
-import org.eclipse.test.internal.performance.results.utils.Util;
+import org.eclipse.test.internal.performance.results.AbstractResults;
+import org.eclipse.test.internal.performance.results.ConfigResults;
+import org.eclipse.test.internal.performance.results.DB_Results;
+import org.eclipse.test.internal.performance.results.PerformanceResults;
+import org.eclipse.test.internal.performance.results.ScenarioResults;
import org.osgi.framework.Bundle;
/**
* Main class to generate performance results of all scenarios matching a given pattern
* in one HTML page per component.
- *
+ *
* @see #printUsage() method to see a detailed parameters usage
*/
public class GenerateResults {
@@ -118,7 +118,7 @@
* <p>
* Example:
* <pre>-current.prefix N, I</pre>
- *
+ *
* @see #baselinePrefix
*/
List currentBuildPrefixes;
@@ -138,7 +138,7 @@
* <p>
* Default is <code>false</code> which means that scenario data
* will also be generated.
- *
+ *
* @see #genData
* @see #genAll
*/
@@ -150,7 +150,7 @@
* <p>
* Default is <code>false</code> which means that fingerprints
* will also be generated.
- *
+ *
* @see #genFingerPrints
* @see #genAll
*/
@@ -163,7 +163,7 @@
* <p>
* Default is <code>true</code> which means that scenario data
* will also be generated.
- *
+ *
* @see #genData
* @see #genFingerPrints
*/
@@ -472,7 +472,7 @@
if (this.printStream != null) {
this.printStream.print(buffer.toString());
}
-
+
// Stop if some mandatory parameters are missing
if (this.outputDir == null || this.configDescriptors == null || jvm == null) {
printUsage();
@@ -489,7 +489,7 @@
if (this.printStream != null) this.printStream.print(".");
File outputFile = new File(this.outputDir, component + ".php");
PrintStream stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
-
+
// Print header
boolean isGlobal = component.startsWith("global");
if (isGlobal) {
@@ -529,20 +529,20 @@
stream.print("<script src=\"ToolTip.js\"></script>\n");
stream.print("<script src=\"Fingerprints.js\"></script>\n");
stream.print(Utils.HTML_DEFAULT_CSS);
-
+
// Print title
stream.print("<body>");
printComponentTitle(/*performanceResults, */component, isGlobal, stream);
// print the html representation of fingerprint for each config
Display display = Display.getDefault();
- if (this.genFingerPrints || this.genAll) {
+ if (genFingerPrints || genAll) {
final FingerPrint fingerprint = new FingerPrint(component, stream, this.outputDir);
display.syncExec(
new Runnable() {
public void run(){
try {
- fingerprint.print(GenerateResults.this.performanceResults);
+ fingerprint.print(performanceResults);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -561,7 +561,7 @@
new Runnable() {
public void run(){
try {
- sst.print(GenerateResults.this.performanceResults);
+ sst.print(performanceResults);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -577,9 +577,9 @@
}
private void printComponentTitle(/*PerformanceResults performanceResults, */String component, boolean isGlobal, PrintStream stream) {
- String baselineName = this.performanceResults.getBaselineName();
- String currentName = this.performanceResults.getName();
-
+ String baselineName = performanceResults.getBaselineName();
+ String currentName = performanceResults.getName();
+
// Print title line
stream.print("<h3>Performance of ");
if (!isGlobal) {
@@ -599,7 +599,7 @@
stream.print(baselineName);
}
stream.print("</h3>\n");
-
+
// Print reference to global results
if (!isGlobal) {
stream.print("<?php\n");
@@ -629,12 +629,12 @@
List scenarioNames = DB_Results.getScenarios();
int size = scenarioNames.size();
printSummaryColumnsTitle(stream/*, performanceResults*/);
- String[] configs = this.performanceResults.getConfigNames(true/*sorted*/);
+ String[] configs = performanceResults.getConfigNames(true/*sorted*/);
int configsLength = configs.length;
for (int i=0; i<size; i++) {
String scenarioName = (String) scenarioNames.get(i);
if (scenarioName == null) continue;
- ScenarioResults scenarioResults = this.performanceResults.getScenarioResults(scenarioName);
+ ScenarioResults scenarioResults = performanceResults.getScenarioResults(scenarioName);
if (scenarioResults != null) {
stream.print("<tr>\n");
for (int j=0; j<2; j++) {
@@ -692,7 +692,7 @@
* Print columns titles of the summary table.
*/
private void printSummaryColumnsTitle(PrintStream stream/*, PerformanceResults performanceResults*/) {
- String[] configBoxes = this.performanceResults.getConfigBoxes(true/*sorted*/);
+ String[] configBoxes = performanceResults.getConfigBoxes(true/*sorted*/);
int length = configBoxes.length;
stream.print("<table border=\"1\"><tr><td colspan=\"");
stream.print(length);
@@ -724,7 +724,7 @@
if (i==0) { // baseline results
List baselinePrefixes = new ArrayList();
if (this.baselinePrefix == null) {
- baselinePrefixes.add(DB_Results.getDbBaselinePrefix());
+ baselinePrefixes.add(AbstractResults.DEFAULT_BASELINE_PREFIX);
} else {
baselinePrefixes.add(this.baselinePrefix);
}
@@ -827,23 +827,23 @@
* Run the generation using a progress monitor.
* Note that all necessary information to generate properly must be set before
* calling this method
- *
+ *
* @see #run(String[])
*/
public IStatus run(final IProgressMonitor monitor) {
long begin = System.currentTimeMillis();
int work = 1100;
int dataWork = 1000 * this.performanceResults.getConfigBoxes(false).length;
- if (this.genAll || this.genData) {
+ if (genAll || genData) {
work += dataWork;
}
SubMonitor subMonitor = SubMonitor.convert(monitor, work);
try {
-
+
// Print whole scenarios summary
if (this.printStream != null) this.printStream.println();
printSummary(/*performanceResults*/);
-
+
// Copy images and scripts to output dir
Bundle bundle = UiPlugin.getDefault().getBundle();
URL images = bundle.getEntry("images");
@@ -876,15 +876,15 @@
if (subdirFiles[i].isDirectory()) {
// expect only one sub-directory
} else {
- Util.copyFile(subdirFiles[j], new File(subdir, subdirFiles[j].getName()));
+ AbstractResults.copyFile(subdirFiles[j], new File(subdir, subdirFiles[j].getName()));
}
}
} else {
- Util.copyFile(file, new File(this.outputDir, file.getName()));
+ AbstractResults.copyFile(file, new File(this.outputDir, file.getName()));
}
}
}
-
+
// Print HTML pages and all linked files
if (this.printStream != null) {
this.printStream.println("Print performance results HTML pages:");
@@ -896,7 +896,7 @@
printComponent(/*performanceResults, */"global_fp");
subMonitor.worked(100);
if (subMonitor.isCanceled()) throw new OperationCanceledException();
- String[] components = this.performanceResults.getComponents();
+ String[] components = performanceResults.getComponents();
int length = components.length;
int step = 1000 / length;
int progress = 0;
@@ -910,29 +910,29 @@
progress++;
}
if (this.printStream != null) {
- String duration = Util.timeString(System.currentTimeMillis()-start);
+ String duration = AbstractResults.timeString(System.currentTimeMillis()-start);
this.printStream.println(" done in "+duration);
}
-
+
// Print the scenarios data
- if (this.genData || this.genAll) {
+ if (genData || genAll) {
start = System.currentTimeMillis();
if (this.printStream != null) this.printStream.println(" - all scenarios data:");
ScenarioData data = new ScenarioData(this.baselinePrefix, this.pointsOfInterest, this.currentBuildPrefixes, this.outputDir);
try {
- data.print(this.performanceResults, this.printStream, subMonitor.newChild(dataWork));
+ data.print(performanceResults, printStream, subMonitor.newChild(dataWork));
} catch (Exception ex) {
ex.printStackTrace();
}
if (this.printStream != null) {
- String duration = Util.timeString(System.currentTimeMillis()-start);
+ String duration = AbstractResults.timeString(System.currentTimeMillis()-start);
this.printStream.println(" => done in "+duration);
}
}
if (this.printStream != null) {
long time = System.currentTimeMillis();
this.printStream.println("End of generation: "+new SimpleDateFormat("H:mm:ss").format(new Date(time)));
- String duration = Util.timeString(System.currentTimeMillis()-begin);
+ String duration = AbstractResults.timeString(System.currentTimeMillis()-begin);
this.printStream.println("=> done in "+duration);
}
return new Status(IStatus.OK, UiPlugin.getDefault().toString(), "Everything is OK");
@@ -968,7 +968,7 @@
}
}
}
-
+
// Verify that build is known
String[] builds = DB_Results.getBuilds();
if (builds == null || builds.length == 0) {
@@ -990,7 +990,7 @@
if (index > 0) {
this.baselinePrefix = baseline.substring(0, index);
} else {
- this.baselinePrefix = DB_Results.getDbBaselinePrefix();
+ this.baselinePrefix = AbstractResults.DEFAULT_BASELINE_PREFIX;
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/LineGraph.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/LineGraph.java
index b7e7eeb..1a15884 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/LineGraph.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/LineGraph.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,9 +20,9 @@
import org.eclipse.test.internal.performance.data.Dim;
public class LineGraph {
-
+
StringBuffer fAreaBuffer;
-
+
private static class GraphItem {
String title;
@@ -42,65 +42,65 @@
this.color= color;
this.description= description;
}
-
+
Point getSize(GC g) {
- Point e1= g.stringExtent(this.description);
- Point e2= g.stringExtent(this.title);
+ Point e1= g.stringExtent(description);
+ Point e2= g.stringExtent(title);
return new Point(Math.max(e1.x, e2.x), e1.y+e2.y);
}
}
-
+
static final int PADDING= 15;
-
+
String fTitle;
List fItems;
Dim fDimension;
-
+
public LineGraph(String title, Dim dim) {
- this.fTitle= title;
- this.fItems= new ArrayList();
- this.fDimension= dim;
+ fTitle= title;
+ fItems= new ArrayList();
+ fDimension= dim;
}
public void paint(Image im) {
-
+
Rectangle bounds= im.getBounds();
-
+
GC g= new GC(im);
- Point ee= g.stringExtent(this.fTitle);
+ Point ee= g.stringExtent(fTitle);
int titleHeight= ee.y;
double maxItem= getMaxItem();
double minItem= getMinItem();
-
+
int max= (int) (Math.ceil(maxItem * (maxItem < 0 ? 0.9 : 1.2)));
int min= (int) (Math.floor(minItem * (minItem < 0 ? 1.2 : 0.9)));
- String smin= this.fDimension.getDisplayValue(min);
+ String smin= fDimension.getDisplayValue(min);
Point emin= g.stringExtent(smin);
-
- String smax= this.fDimension.getDisplayValue(max);
+
+ String smax= fDimension.getDisplayValue(max);
Point emax= g.stringExtent(smax);
-
+
int labelWidth= Math.max(emin.x, emax.x) + 2;
-
+
int top= PADDING;
int bottom= bounds.height - titleHeight - PADDING;
int left= PADDING + labelWidth;
- GraphItem lastItem= (GraphItem) this.fItems.get(this.fItems.size()-1);
+ GraphItem lastItem= (GraphItem) fItems.get(fItems.size()-1);
int right= bounds.width - lastItem.getSize(g).x - PADDING/2;
// draw the title
//g.drawString(fTitle, (bounds.width - titleWidth) / 2, titleHeight, true);
-
+
// draw the max and min values
g.drawString(smin, PADDING/2+labelWidth-emin.x, bottom-titleHeight, true);
g.drawString(smax, PADDING/2+labelWidth-emax.x, top, true);
-
+
// draw the vertical and horizontal lines
g.drawLine(left, top, left, bottom);
g.drawLine(left, bottom, right, bottom);
@@ -108,40 +108,40 @@
Color oldbg= g.getBackground();
Color oldfg= g.getForeground();
- int n= this.fItems.size();
+ int n= fItems.size();
int xincrement= n > 1 ? (right-left) / (n-1) : 0;
-
+
int graduations= max - min;
if (graduations == 0)
graduations= 1;
-
+
int lastx= 0;
int lasty= 0;
int xposition= left;
for (int i= 0; i < n; i++) {
- GraphItem thisItem= (GraphItem) this.fItems.get(i);
-
+ GraphItem thisItem= (GraphItem) fItems.get(i);
+
int yposition= (int) (bottom - (((thisItem.value-min) * (bottom-top)) / graduations));
if (i > 0) // don't draw for first segment
g.drawLine(lastx, lasty, xposition, yposition);
-
+
g.setBackground(thisItem.color);
g.setForeground(thisItem.color);
g.fillOval(xposition-2, yposition-2, 5, 5);
-
- if (this.fAreaBuffer == null)
- this.fAreaBuffer= new StringBuffer();
-
- this.fAreaBuffer.append("\r<area shape=\"CIRCLE\" coords=\""+(xposition-2)+','+(yposition-2)+','+5+" alt=\""+ thisItem.title+": "+thisItem.description+"\""+ " title=\""+ thisItem.title+": "+thisItem.description+"\">");
-
-
+
+ if (fAreaBuffer == null)
+ fAreaBuffer= new StringBuffer();
+
+ fAreaBuffer.append("\r<area shape=\"CIRCLE\" coords=\""+(xposition-2)+','+(yposition-2)+','+5+" alt=\""+ thisItem.title+": "+thisItem.description+"\""+ " title=\""+ thisItem.title+": "+thisItem.description+"\">");
+
+
int shift;
if (i > 0 && yposition < lasty)
shift= 3; // below dot
- else
+ else
shift= -(2*titleHeight+3); // above dot
if (thisItem.displayDescription){
g.drawString(thisItem.title, xposition+2, yposition+shift, true);
@@ -149,12 +149,12 @@
}
g.setBackground(oldbg);
g.setForeground(oldfg);
-
+
lastx= xposition;
lasty= yposition;
xposition+= xincrement;
}
-
+
g.dispose();
}
@@ -163,13 +163,13 @@
}
public void addItem(String name, String description, double value, Color col, boolean display) {
- this.fItems.add(new GraphItem(name, description, value, col,display));
+ fItems.add(new GraphItem(name, description, value, col,display));
}
public double getMaxItem() {
double maxItem= 0;
- for (int i= 0; i < this.fItems.size(); i++) {
- GraphItem graphItem= (GraphItem) this.fItems.get(i);
+ for (int i= 0; i < fItems.size(); i++) {
+ GraphItem graphItem= (GraphItem) fItems.get(i);
if (graphItem.value > maxItem)
maxItem= graphItem.value;
}
@@ -180,8 +180,8 @@
public double getMinItem() {
double minItem= getMaxItem();
- for (int i= 0; i < this.fItems.size(); i++) {
- GraphItem graphItem= (GraphItem) this.fItems.get(i);
+ for (int i= 0; i < fItems.size(); i++) {
+ GraphItem graphItem= (GraphItem) fItems.get(i);
if (graphItem.value < minItem)
minItem= graphItem.value;
}
@@ -190,9 +190,9 @@
return minItem;
}
public String getAreas() {
- if (this.fAreaBuffer != null) {
- String s= this.fAreaBuffer.toString();
- this.fAreaBuffer= null;
+ if (fAreaBuffer != null) {
+ String s= fAreaBuffer.toString();
+ fAreaBuffer= null;
return s;
}
return null;
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
index fa904ee..c429639 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Main.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@
/**
* Main class to generate performance results of all scenarios matching a given pattern
* in one HTML page per component.
- *
+ *
* @see GenerateResults for the complete implementation
*/
public class Main implements IApplication {
@@ -33,7 +33,7 @@
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
*/
public Object start(IApplicationContext context) throws Exception {
-
+
GenerateResults generation = new GenerateResults();
String[] args = (String[]) context.getArguments().get("application.args");
generation.run(args);
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/RawDataTable.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/RawDataTable.java
index d2df869..bac35c3 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/RawDataTable.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/RawDataTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,9 +16,9 @@
import java.util.List;
import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.results.db.BuildResults;
-import org.eclipse.test.internal.performance.results.db.ConfigResults;
-import org.eclipse.test.internal.performance.results.db.DB_Results;
+import org.eclipse.test.internal.performance.results.AbstractResults;
+import org.eclipse.test.internal.performance.results.BuildResults;
+import org.eclipse.test.internal.performance.results.ConfigResults;
/**
* Class used to fill details file of scenario builds data.
@@ -29,7 +29,7 @@
private ConfigResults configResults;
private List buildPrefixes;
private PrintStream stream;
- private Dim[] dimensions = DB_Results.getResultsDimensions();
+ private Dim[] dimensions = AbstractResults.SUPPORTED_DIMS;
private boolean debug = false;
private RawDataTable(ConfigResults results, PrintStream ps) {
@@ -51,10 +51,10 @@
* Print all build data to the current stream.
*/
public void print(){
- this.stream.print("<table border=\"1\">");
+ stream.print("<table border=\"1\">");
printSummary();
printDetails();
- this.stream.print("</table>\n");
+ stream.print("</table>\n");
}
/*
@@ -68,80 +68,79 @@
buffer.append(this.dimensions[i].getName());
buffer.append("</b></td>");
}
- this.stream.print(buffer.toString());
+ stream.print(buffer.toString());
}
/*
* Print all build results in the table.
*/
private void printDetails() {
- this.stream.print("<tr><td><b>Build ID</b></td>");
+ stream.print("<tr><td><b>Build ID</b></td>");
printColumnHeaders();
- this.stream.print("</tr>\n");
+ stream.print("</tr>\n");
List builds = this.configResults.getBuildsMatchingPrefixes(this.buildPrefixes);
Collections.reverse(builds);
int size = builds.size();
for (int i=0; i<size; i++) {
BuildResults buildResults = (BuildResults) builds.get(i);
- this.stream.print("<tr><td>");
- this.stream.print(buildResults.getName());
- this.stream.print("</td>");
+ stream.print("<tr><td>");
+ stream.print(buildResults.getName());
+ stream.print("</td>");
int dimLength = this.dimensions.length;
for (int d=0; d<dimLength; d++) {
- Dim dimension = this.dimensions[d];
- int dim_id = dimension.getId();
+ int dim_id = this.dimensions[d].getId();
double value = buildResults.getValue(dim_id);
- printDimTitle(dimension.getName());
- String displayValue = dimension.getDisplayValue(value);
- this.stream.print(displayValue);
- if (this.debug) System.out.print("\t"+displayValue);
- this.stream.print("</td>");
+ printDimTitle(this.dimensions[d].getName());
+ String displayValue = this.dimensions[d].getDisplayValue(value);
+ stream.print(displayValue);
+ if (debug) System.out.print("\t"+displayValue);
+ stream.print("</td>");
}
- if (this.debug) System.out.println();
- this.stream.print("</tr>\n");
+ if (debug) System.out.println();
+ stream.print("</tr>\n");
}
- if (this.debug) System.out.println("\n");
+ if (debug) System.out.println("\n");
}
/*
* Print summary on top of the table.
*/
private void printSummary() {
- this.stream.print("<tr><td><b>Stats</b></td>");
+ stream.print("<tr><td><b>Stats</b></td>");
printColumnHeaders();
- this.stream.print("</tr>\n");
+ stream.print("</tr>\n");
int length = this.dimensions.length;
- double[][] dimStats = new double[length][];
- for (int i=0; i<length; i++) {
+ double[][] dimStats = new double[2][];
+ for (int i=0; i<this.dimensions.length; i++) {
dimStats[i] = this.configResults.getStatistics(this.buildPrefixes, this.dimensions[i].getId());
}
- this.stream.print("<tr><td>#BUILDS SAMPLED</td>");
+ stream.print("<tr><td>#BUILDS SAMPLED</td>");
for (int i=0; i<length; i++) {
String dimName = this.dimensions[i].getName();
printDimTitle(dimName);
- this.stream.print((int)dimStats[i][0]);
- this.stream.print("</td>");
+ stream.print((int)dimStats[i][0]);
+ stream.print("</td>");
}
- this.stream.print("</tr>\n");
- this.stream.print("<tr><td>MEAN</td>");
+ stream.print("</tr>\n");
+ stream.print("<tr><td>MEAN</td>");
printRowDoubles(dimStats, 1);
- this.stream.print("</tr>\n");
- this.stream.print("<tr><td>STD DEV</td>");
+ stream.print("</tr>\n");
+ stream.print("<tr><td>STD DEV</td>");
printRowDoubles(dimStats, 2);
- this.stream.print("</tr>\n");
- this.stream.print("<tr><td>COEF. VAR</td>");
+ stream.print("</tr>\n");
+ stream.print("<tr><td>COEF. VAR</td>");
printRowDoubles(dimStats, 3);
- this.stream.print("</tr>\n");
+ stream.print("</tr>\n");
// Blank line
- this.stream.print("<tr>");
+ stream.print("<tr>");
for (int i=0; i<length+1; i++){
- this.stream.print("<td> </td>");
+ stream.print("<td> </td>");
}
- this.stream.print("</tr>\n");
+ stream.print("</tr>\n");
}
/*
@@ -154,20 +153,20 @@
String dimName = this.dimensions[i].getName();
if (idx == 3) {
if (value>10 && value<20) {
- this.stream.print("<td bgcolor=\"yellow\" title=\"");
+ stream.print("<td bgcolor=\"yellow\" title=\"");
} else if (value>=20) {
- this.stream.print("<td bgcolor=\"FF9900\" title=\"");
+ stream.print("<td bgcolor=\"FF9900\" title=\"");
} else {
- this.stream.print("<td title=\"");
+ stream.print("<td title=\"");
}
- this.stream.print(dimName);
- this.stream.print("\">");
- this.stream.print(value);
- this.stream.print("%</td>");
+ stream.print(dimName);
+ stream.print("\">");
+ stream.print(value);
+ stream.print("%</td>");
} else {
printDimTitle(dimName);
- this.stream.print(this.dimensions[i].getDisplayValue(value));
- this.stream.print("</td>");
+ stream.print(this.dimensions[i].getDisplayValue(value));
+ stream.print("</td>");
}
}
}
@@ -177,8 +176,8 @@
* TODO (frederic) See if this title is really necessary
*/
private void printDimTitle(String dimName) {
- this.stream.print("<td title=\"");
- this.stream.print(dimName);
- this.stream.print("\">");
+ stream.print("<td title=\"");
+ stream.print(dimName);
+ stream.print("\">");
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
index 9278a1c..011ba00 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -32,13 +32,12 @@
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.results.db.BuildResults;
-import org.eclipse.test.internal.performance.results.db.ComponentResults;
-import org.eclipse.test.internal.performance.results.db.ConfigResults;
-import org.eclipse.test.internal.performance.results.db.DB_Results;
-import org.eclipse.test.internal.performance.results.db.PerformanceResults;
-import org.eclipse.test.internal.performance.results.db.ScenarioResults;
-import org.eclipse.test.internal.performance.results.utils.Util;
+import org.eclipse.test.internal.performance.results.AbstractResults;
+import org.eclipse.test.internal.performance.results.BuildResults;
+import org.eclipse.test.internal.performance.results.ComponentResults;
+import org.eclipse.test.internal.performance.results.ConfigResults;
+import org.eclipse.test.internal.performance.results.PerformanceResults;
+import org.eclipse.test.internal.performance.results.ScenarioResults;
/**
* Class used to print scenario all builds data.
@@ -50,7 +49,6 @@
private File rootDir;
private static final int GRAPH_WIDTH = 600;
private static final int GRAPH_HEIGHT = 200;
- private Dim[] dimensions = DB_Results.getResultsDimensions();
/**
* Summary of results for a scenario for a given build compared to a
@@ -99,7 +97,6 @@
String baseline = configResults.getBaselineBuildName();
String current = configResults.getCurrentBuildName();
- final String defaultBaselinePrefix = DB_Results.getDbBaselinePrefix();
Iterator builds = configResults.getResults();
List lastSevenNightlyBuilds = configResults.lastNightlyBuildNames(7);
buildLoop: while (builds.hasNext()) {
@@ -107,8 +104,8 @@
String buildID = buildResults.getName();
int underscoreIndex = buildID.indexOf('_');
String label = (underscoreIndex != -1 && buildID.equals(current)) ? buildID.substring(0, underscoreIndex) : buildID;
- if (buildID.startsWith(defaultBaselinePrefix)) {
- label = defaultBaselinePrefix+buildID.charAt(defaultBaselinePrefix.length())+buildID.substring(underscoreIndex);
+ if (buildID.startsWith(AbstractResults.DEFAULT_BASELINE_PREFIX)) {
+ label = AbstractResults.DEFAULT_BASELINE_PREFIX+buildID.charAt(AbstractResults.DEFAULT_BASELINE_PREFIX.length())+buildID.substring(underscoreIndex);
}
double value = buildResults.getValue(dim.getId());
@@ -138,12 +135,12 @@
}
}
if (buildID.equals(baseline)) {
- boolean drawBaseline = (this.baselinePrefix != null) ? false : true;
+ boolean drawBaseline = (baselinePrefix != null) ? false : true;
graph.addItem("reference", label, dim.getDisplayValue(value), value, magenta, true, Utils.getDateFromBuildID(buildID, true), true, drawBaseline);
continue;
}
- if (this.baselinePrefix != null) {
- if (buildID.startsWith(this.baselinePrefix) && !buildID.equals(baseline) && Utils.getDateFromBuildID(buildID, true) <= Utils.getDateFromBuildID(baseline, true)) {
+ 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;
}
@@ -154,7 +151,7 @@
/**
* Print the scenario all builds data from the given performance results.
- *
+ *
* @param performanceResults The needed information to generate scenario data
*/
public void print(PerformanceResults performanceResults, PrintStream printStream, final SubMonitor subMonitor) {
@@ -168,11 +165,11 @@
for (int i=0; i<length; i++) {
final String configName = configNames[i];
final String configBox = configBoxes[i];
-
+
// Manage monitor
subMonitor.setTaskName("Generating data for "+configBox);
if (subMonitor.isCanceled()) throw new OperationCanceledException();
-
+
long start = System.currentTimeMillis();
if (printStream != null) printStream.print(" + "+configName);
final File outputDir = new File(this.rootDir, configName);
@@ -181,7 +178,7 @@
while (components.hasNext()) {
if (printStream != null) printStream.print(".");
final ComponentResults componentResults = (ComponentResults) components.next();
-
+
// Manage monitor
int percentage = (int) ((progress++ / total) * 100);
subMonitor.setTaskName("Generating data for "+configBox+": "+percentage+"%");
@@ -202,7 +199,7 @@
if (subMonitor.isCanceled()) throw new OperationCanceledException();
}
if (printStream != null) {
- String duration = Util.timeString(System.currentTimeMillis()-start);
+ String duration = AbstractResults.timeString(System.currentTimeMillis()-start);
printStream.println(" done in "+duration);
}
}
@@ -274,10 +271,10 @@
// Print build result table
stream.print("<table border=\"1\">\n"); //$NON-NLS-1$
stream.print("<tr><td><b>Build Id</b></td>"); //$NON-NLS-1$
- int dimLength = this.dimensions.length;
+ Dim[] dimensions = AbstractResults.SUPPORTED_DIMS;
+ int dimLength = dimensions.length;
for (int d=0; d<dimLength; d++) {
- Dim dim = this.dimensions[d];
- stream.print("<td><a href=\"#" + dim.getLabel() + "\"><b>" + dim.getName() + "</b></a></td>");
+ stream.print("<td><a href=\"#" + dimensions[d].getShortName() + "\"><b>" + dimensions[d].getName() + "</b></a></td>");
}
stream.print("</tr>\n");
@@ -300,17 +297,16 @@
// print image maps of historical
for (int d=0; d<dimLength; d++) {
- Dim dim = this.dimensions[d];
- TimeLineGraph lineGraph = getLineGraph(scenarioResults, configResults, dim, highlightedPoints, this.buildIDStreamPatterns);
+ TimeLineGraph lineGraph = getLineGraph(scenarioResults, configResults, dimensions[d], highlightedPoints, this.buildIDStreamPatterns);
if (subMonitor.isCanceled()) throw new OperationCanceledException();
- String dimShortName = dim.getLabel();
+ String dimShortName = dimensions[d].getShortName();
String imgFileName = scenarioFileName + "_" + dimShortName;
File imgFile = createFile(outputDir, "graphs", imgFileName, "gif");
saveGraph(lineGraph, imgFile);
stream.print("<br><a name=\"" + dimShortName + "\"></a>\n");
- stream.print("<br><b>" + dim.getName() + "</b><br>\n");
- stream.print(dim.getDescription() + "<br><br>\n");
+ stream.print("<br><b>" + dimensions[d].getName() + "</b><br>\n");
+ stream.print(dimensions[d].getDescription() + "<br><br>\n");
stream.print("<img src=\"graphs/");
stream.print(imgFile.getName());
stream.print("\" usemap=\"#" + lineGraph.fTitle + "\">");
@@ -339,19 +335,19 @@
stream.print(buildResults.getName());
if (buildResults.isBaseline()) stream.print(" (reference)");
stream.print("</td>");
- int dimLength = this.dimensions.length;
+ Dim[] dimensions = AbstractResults.SUPPORTED_DIMS;
+ int dimLength = dimensions.length;
for (int d=0; d<dimLength; d++) {
- Dim dim = this.dimensions[d];
- int dim_id = dim.getId();
+ int dim_id = dimensions[d].getId();
double stddev = buildResults.getDeviation(dim_id);
- String displayValue = dim.getDisplayValue(buildResults.getValue(dim_id));
+ String displayValue = dimensions[d].getDisplayValue(buildResults.getValue(dim_id));
stream.print("<td>");
stream.print(displayValue);
if (stddev < 0) {
stream.print(" [n/a]\n");
} else if (stddev > 0) {
stream.print(" [");
- stream.print(dim.getDisplayValue(stddev));
+ stream.print(dimensions[d].getDisplayValue(stddev));
stream.print("]");
}
stream.print( "</td>");
@@ -364,9 +360,10 @@
*/
private void printDifferenceLine(PrintStream stream, ConfigResults configResults) {
stream.print("<tr><td>*Delta</td>");
- int dimLength = this.dimensions.length;
+ Dim[] dimensions = AbstractResults.SUPPORTED_DIMS;
+ int dimLength = dimensions.length;
for (int d=0; d<dimLength; d++) {
- Dim currentDim = this.dimensions[d];
+ Dim currentDim = dimensions[d];
int dim_id = currentDim.getId();
BuildResults currentBuild = configResults.getCurrentBuildResults();
BuildResults baselineBuild = configResults.getBaselineBuildResults();
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioStatusTable.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioStatusTable.java
index 2a39253..9c2f312 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioStatusTable.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/ScenarioStatusTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,10 +14,10 @@
import java.util.List;
import java.util.StringTokenizer;
-import org.eclipse.test.internal.performance.results.db.BuildResults;
-import org.eclipse.test.internal.performance.results.db.ConfigResults;
-import org.eclipse.test.internal.performance.results.db.PerformanceResults;
-import org.eclipse.test.internal.performance.results.db.ScenarioResults;
+import org.eclipse.test.internal.performance.results.BuildResults;
+import org.eclipse.test.internal.performance.results.ConfigResults;
+import org.eclipse.test.internal.performance.results.PerformanceResults;
+import org.eclipse.test.internal.performance.results.ScenarioResults;
/**
* Class used to print a scenario status table.
@@ -54,7 +54,7 @@
this.stream.print(computeSize(scenarios));
this.stream.print(" scenarios</h4></td>\n");
printColumnsTitle(size, performanceResults);
-
+
// Print one line per scenario results
this.jsIdCount = 0;
for (int i=0; i<size; i++) {
@@ -164,9 +164,9 @@
// create message with tooltip text including deviation with error plus failure message
this.jsIdCount+=1;
this.stream.print("class=\"tooltipSource\" onMouseover=\"show_element('toolTip");
- this.stream.print(this.jsIdCount);
+ this.stream.print(jsIdCount);
this.stream.print("')\" onMouseout=\"hide_element('toolTip");
- this.stream.print(this.jsIdCount);
+ this.stream.print(jsIdCount);
this.stream.print("')\" \nhref=\"");
this.stream.print(configResults.getName());
this.stream.print('/');
@@ -176,7 +176,7 @@
this.stream.print(image);
this.stream.print("\"/>\n");
this.stream.print("<span class=\"hidden_tooltip\" id=\"toolTip");
- this.stream.print(this.jsIdCount);
+ this.stream.print(jsIdCount);
this.stream.print("\">");
this.stream.print(failure);
this.stream.print("</span></a>\n");
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraph.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraph.java
index 467bdd5..514eec1 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraph.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraph.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,52 +20,52 @@
import org.eclipse.test.internal.performance.data.Dim;
public class TimeLineGraph extends LineGraph{
-
+
Hashtable fItemGroups;
-
+
public TimeLineGraph (String title, Dim dim) {
super(title, dim);
- this.fItemGroups=new Hashtable();
+ fItemGroups=new Hashtable();
}
public void paint(Image im) {
-
+
Rectangle bounds= im.getBounds();
-
+
GC g= new GC(im);
- Point ee= g.stringExtent(this.fTitle);
+ Point ee= g.stringExtent(fTitle);
int titleHeight= ee.y;
double maxItem= getMaxItem();
double minItem= getMinItem();
-
+
int max= (int) (Math.ceil(maxItem * (maxItem < 0 ? 0.8 : 1.2)));
int min= (int) (Math.floor(minItem * (minItem < 0 ? 1.2 : 0.8)));
- String smin= this.fDimension.getDisplayValue(min);
+ String smin= fDimension.getDisplayValue(min);
Point emin= g.stringExtent(smin);
-
- String smax= this.fDimension.getDisplayValue(max);
+
+ String smax= fDimension.getDisplayValue(max);
Point emax= g.stringExtent(smax);
-
+
int labelWidth= Math.max(emin.x, emax.x) + 2;
-
+
int top= PADDING;
int bottom= bounds.height - titleHeight - PADDING;
int left= PADDING + labelWidth;
//getMostRecent
- TimeLineGraphItem lastItem= getMostRecent(this.fItemGroups);
+ TimeLineGraphItem lastItem= getMostRecent(fItemGroups);
int right=bounds.width - PADDING/2;
if (lastItem!=null)
right= bounds.width - lastItem.getSize(g).x - PADDING/2;
-
+
// draw the max and min values
g.drawString(smin, PADDING/2+labelWidth-emin.x, bottom-titleHeight, true);
g.drawString(smax, PADDING/2+labelWidth-emax.x, top, true);
g.drawString("TIME (not drawn to scale)", (right-left)/3+PADDING+titleHeight,bottom-PADDING+(titleHeight*2), true);
-
+
// draw the vertical and horizontal lines
g.drawLine(left, top, left, bottom);
g.drawLine(left, bottom, right, bottom);
@@ -74,10 +74,10 @@
Color oldfg= g.getForeground();
setCoordinates(right-left,left,bottom-top,bottom,max-min);
-
- Enumeration _enum=this.fItemGroups.elements();
+
+ Enumeration _enum=fItemGroups.elements();
Comparator comparator=new TimeLineGraphItem.GraphItemComparator();
-
+
while (_enum.hasMoreElements()) {
List items = (List) _enum.nextElement();
Object[] fItemsArray=items.toArray();
@@ -93,16 +93,16 @@
int yposition = thisItem.y;
int xposition = thisItem.x;
g.setLineWidth(1);
-
+
g.setBackground(thisItem.color);
g.setForeground(thisItem.color);
if (thisItem.drawAsBaseline){
- g.setLineWidth(0);
+ g.setLineWidth(0);
g.drawLine(xposition, yposition,right,yposition);
g.drawLine(left,yposition,xposition, yposition);
}
-
+
if (i > 0) // don't draw for first segment
g.drawLine(lastx, lasty, xposition, yposition);
@@ -113,11 +113,11 @@
if (thisItem.isSpecial)
g.drawRectangle(xposition -4, yposition - 4, 8, 8);
+
+ if (fAreaBuffer == null)
+ fAreaBuffer = new StringBuffer();
- if (this.fAreaBuffer == null)
- this.fAreaBuffer = new StringBuffer();
-
- this.fAreaBuffer.append("\r<area shape=\"circle\" coords=\""
+ fAreaBuffer.append("\r<area shape=\"circle\" coords=\""
+ (xposition - 2) + ',' + (yposition - 2) + ',' + 5
+ " alt=\"" + thisItem.title + ": "
+ thisItem.description + "\"" + " title=\""
@@ -141,10 +141,10 @@
lasty = yposition;
}
}
-
+
g.dispose();
}
-
+
public void addItem(String groupName,String name, String description, double value, Color col, boolean display, long timestamp) {
addItem(groupName, name, description, value, col, display, timestamp,false);
}
@@ -155,17 +155,17 @@
}
public void addItem(String groupName,String name, String description, double value, Color col, boolean display, long timestamp,boolean isSpecial,boolean drawBaseline) {
- List items = (List) this.fItemGroups.get(groupName);
- if (this.fItemGroups.get(groupName) == null) {
+ List items = (List) fItemGroups.get(groupName);
+ if (fItemGroups.get(groupName) == null) {
items=new ArrayList();
- this.fItemGroups.put(groupName, items);
+ fItemGroups.put(groupName, items);
}
items.add(new TimeLineGraphItem(name, description, value, col, display,
timestamp,isSpecial,drawBaseline));
}
-
+
public double getMaxItem() {
- Enumeration _enum=this.fItemGroups.elements();
+ Enumeration _enum=fItemGroups.elements();
double maxItem= 0;
while (_enum.hasMoreElements()) {
List items = (List) _enum.nextElement();
@@ -181,7 +181,7 @@
}
public double getMinItem() {
- Enumeration _enum = this.fItemGroups.elements();
+ Enumeration _enum = fItemGroups.elements();
double minItem = getMaxItem();
while (_enum.hasMoreElements()) {
@@ -196,7 +196,7 @@
return -1;
return minItem;
}
-
+
private TimeLineGraphItem getMostRecent(Hashtable lineGraphGroups) {
Enumeration _enum = lineGraphGroups.elements();
long mostRecentTimestamp = 0;
@@ -218,14 +218,14 @@
}
return mostRecentItem;
}
-
+
private void setCoordinates(int width, int xOffset, int height, int yOffset, int yValueRange){
-
- List mainGroup=(ArrayList)this.fItemGroups.get("main");
- List referenceGroup=(ArrayList)this.fItemGroups.get("reference");
-
+
+ List mainGroup=(ArrayList)fItemGroups.get("main");
+ List referenceGroup=(ArrayList)fItemGroups.get("reference");
+
Comparator comparator=new TimeLineGraphItem.GraphItemComparator();
-
+
Object[] fItemsArray=mainGroup.toArray();
Arrays.sort(fItemsArray,comparator);
@@ -238,12 +238,12 @@
TimeLineGraphItem thisItem = (TimeLineGraphItem) fItemsArray[i];
thisItem.setX(xOffset + (i * xIncrement));
thisItem.setY((int)(PADDING+((max-thisItem.value) * (height)/(yValueRange))));
-
+
}
-
+
if (referenceGroup==null)
return;
-
+
n = referenceGroup.size();
for (int i = 0; i < n; i++) {
TimeLineGraphItem thisItem = (TimeLineGraphItem) referenceGroup.get(i);
@@ -256,19 +256,19 @@
}
}
-
+
private void setRelativeXPosition (TimeLineGraphItem thisItem, List items){
Comparator comparator=new TimeLineGraphItem.GraphItemComparator();
Object[] fItemsArray=items.toArray();
Arrays.sort(fItemsArray,comparator);
-
+
TimeLineGraphItem closestPrecedingItem=null;
long minimumTimeDiffPreceding=thisItem.timestamp;
-
+
TimeLineGraphItem closestFollowingItem=null;
long minimumTimeDiffFollowing=thisItem.timestamp;
-
+
for (int i=0;i<fItemsArray.length;i++){
TimeLineGraphItem anItem=(TimeLineGraphItem)fItemsArray[i];
long timeDiff=thisItem.timestamp-anItem.timestamp;
@@ -276,7 +276,7 @@
if (timeDiff>0&&timeDiff<minimumTimeDiffPreceding){
closestPrecedingItem=anItem;
minimumTimeDiffPreceding=thisItem.timestamp-anItem.timestamp;
- }
+ }
if (timeDiff<=0&&Math.abs(timeDiff)<=minimumTimeDiffFollowing){
closestFollowingItem=anItem;
minimumTimeDiffFollowing=thisItem.timestamp-anItem.timestamp;
@@ -287,12 +287,12 @@
else if (closestFollowingItem!=null && closestPrecedingItem==null)
thisItem.setX(closestFollowingItem.x);
- else{
+ else{
long timeRange=closestFollowingItem.timestamp-closestPrecedingItem.timestamp;
-
+
int xRange=closestFollowingItem.x-closestPrecedingItem.x;
double increments=(xRange*1.0)/timeRange;
-
+
thisItem.setX((int)(Math.round((thisItem.timestamp-closestPrecedingItem.timestamp)*increments)+closestPrecedingItem.x));
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraphItem.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraphItem.java
index c52d0a9..cd24861 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraphItem.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/TimeLineGraphItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,17 +29,17 @@
boolean drawAsBaseline=false;
int x;
int y;
-
+
TimeLineGraphItem(String title, String description,double value,Color color,boolean display, long timestamp, boolean isSpecial,boolean isBaseline) {
this(title, description, value, color,display, timestamp,isSpecial);
this.drawAsBaseline=isBaseline;
}
-
+
TimeLineGraphItem(String title, String description,double value,Color color,boolean display, long timestamp, boolean isSpecial) {
this(title, description, value, color,display, timestamp);
this.isSpecial=isSpecial;
}
-
+
TimeLineGraphItem(String title, String description,double value,Color color,boolean display, long timestamp) {
this(title, description, value, color,timestamp);
this.displayDescription=display;
@@ -52,10 +52,10 @@
this.description= description;
this.timestamp=timestamp;
}
-
+
Point getSize(GC g) {
- Point e1= g.stringExtent(this.description);
- Point e2= g.stringExtent(this.title);
+ Point e1= g.stringExtent(description);
+ Point e2= g.stringExtent(title);
return new Point(Math.max(e1.x, e2.x), e1.y+e2.y);
}
@@ -63,7 +63,7 @@
public int compare(Object o1, Object o2) {
long ts1=((TimeLineGraphItem)o1).timestamp;
long ts2=((TimeLineGraphItem)o2).timestamp;
-
+
if (ts1>ts2)
return 1;
if (ts1<ts2)
@@ -74,7 +74,7 @@
}
public int getX() {
- return this.x;
+ return x;
}
public void setX(int x) {
@@ -82,7 +82,7 @@
}
public int getY() {
- return this.y;
+ return y;
}
public void setY(int y) {
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/UiPlugin.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/UiPlugin.java
index d7d2b28..29f52be 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/UiPlugin.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/UiPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,24 +10,22 @@
*******************************************************************************/
package org.eclipse.test.performance.ui;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
-public class UiPlugin extends AbstractUIPlugin {
+public class UiPlugin extends Plugin {
//The shared instance.
private static UiPlugin plugin;
-
+
/**
* The constructor.
*/
public UiPlugin() {
super();
- if (plugin == null) {
- plugin = this;
- }
+ plugin = this;
}
/**
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
index 0dbf450..af5c2c8 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/performance/ui/Utils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,7 +30,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.utils.Util;
+import org.eclipse.test.internal.performance.results.AbstractResults;
public class Utils {
@@ -109,23 +109,23 @@
* Copy all image files.
*/
public static void copyImages(File images, File output) {
- Util.copyFile(new File(images, FAIL_IMAGE), new File(output, FAIL_IMAGE));
- Util.copyFile(new File(images, FAIL_IMAGE_EXPLAINED), new File(output, FAIL_IMAGE_EXPLAINED));
- Util.copyFile(new File(images, FAIL_IMAGE_WARN), new File(output, FAIL_IMAGE_WARN));
- Util.copyFile(new File(images, OK_IMAGE), new File(output, OK_IMAGE));
- Util.copyFile(new File(images, OK_IMAGE_WARN), new File(output, OK_IMAGE_WARN));
- Util.copyFile(new File(images, UNKNOWN_IMAGE), new File(output, UNKNOWN_IMAGE));
- Util.copyFile(new File(images, LIGHT), new File(output, LIGHT));
- Util.copyFile(new File(images, WARNING_OBJ), new File(output, WARNING_OBJ));
+ 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));
+ AbstractResults.copyFile(new File(images, LIGHT), new File(output, LIGHT));
+ AbstractResults.copyFile(new File(images, WARNING_OBJ), new File(output, WARNING_OBJ));
}
/**
* Copy all scripts files.
*/
public static void copyScripts(File scripts, File output) {
- Util.copyFile(new File(scripts, "ToolTip.css"), new File(output, "ToolTip.css"));
- Util.copyFile(new File(scripts, "ToolTip.js"), new File(output, "ToolTip.js"));
- Util.copyFile(new File(scripts, "Fingerprints.js"), new File(output, "Fingerprints.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"));
+ AbstractResults.copyFile(new File(scripts, "Fingerprints.js"), new File(output, "Fingerprints.js"));
}
/**
@@ -140,7 +140,7 @@
subdir.mkdir();
copyDoc(file, subdir);
} else {
- Util.copyFile(file, new File(output, file.getName()));
+ AbstractResults.copyFile(file, new File(output, file.getName()));
}
}
}
@@ -173,7 +173,7 @@
int count;
public int compareTo(Object o) {
- return ((ColorCounter) o).count - this.count;
+ return ((ColorCounter) o).count - count;
}
}
@@ -289,10 +289,10 @@
return -1;
}
-
+
/**
* Returns a message corresponding to given statistics.
- *
+ *
* @param resultStats The value with its standard error
* @param full
* @return The failure message. May be empty if stats are good...
@@ -332,7 +332,7 @@
}
return buffer.toString();
}
-
+
/**
* Returns the confidence level for given statistics:
* <ul>
@@ -340,7 +340,7 @@
* <li>{@link #ERR}: if the standard error is over the expected threshold ({@link #STANDARD_ERROR_THRESHOLD})</li>
* <li>{@link #OK}: in all other cases</li>
* </ul>
- *
+ *
* @param resultStats array of 2 doubles, the former is the average value and
* the latter is the standard error made while computing the average.
* @return a value telling caller the level of confidence of the provided value
@@ -364,7 +364,7 @@
/**
* Get an icon image corresponding to a given level of confidence and explanation.
- *
+ *
* @param confidence the confiden level
* @param hasExplanation flags indicates whether the confidence may be tempered by an explanation
* @return Corresponding image