*** empty log message ***
diff --git a/bundles/org.eclipse.test.performance.ui/performanceui.jar b/bundles/org.eclipse.test.performance.ui/performanceui.jar
index 9fcb65e..fea51ff 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/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java
index 7c903a6..8d3c8ac 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/db/PerformanceResults.java
@@ -556,8 +556,8 @@
// Read build info
String str = stream.readUTF();
- this.needToUpdateLocalFile = this.name == null || this.name.compareTo(str) > 0;
- if (this.name != null && this.name.compareTo(str) >= 0) {
+ this.needToUpdateLocalFile = this.name == null || Util.getBuildDate(this.name).compareTo(Util.getBuildDate(str)) > 0;
+ if (this.name != null && Util.getBuildDate(this.name).compareTo(Util.getBuildDate(str)) >= 0) {
return;
}
println(" - read performance results local files info: "); //$NON-NLS-1$
@@ -672,10 +672,12 @@
if (buildsSize > 0) {
builds.toArray(this.allBuildNames);
int idx = this.allBuildNames.length-1;
- this.name = this.allBuildNames[idx--];
+ String lastBuildName = this.allBuildNames[idx--];
while (this.name.startsWith(DB_Results.getDbBaselinePrefix())) {
- this.name = this.allBuildNames[idx--];
+ lastBuildName = this.allBuildNames[idx--];
}
+ this.needToUpdateLocalFile = this.name == null || Util.getBuildDate(lastBuildName).compareTo(Util.getBuildDate(this.name)) > 0;
+ this.name = lastBuildName;
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/BuildResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/BuildResultsElement.java
index 30c9c92..82c1766 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/BuildResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/BuildResultsElement.java
@@ -362,5 +362,11 @@
public String toString() {
return getName();
}
+public boolean isBefore(String build) {
+ if (this.results != null) {
+ return Util.getBuildDate(this.name).compareTo(Util.getBuildDate(build)) <= 0;
+ }
+ return true;
+}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ComponentResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ComponentResultsElement.java
index 2e82bce..ee05ceb 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ComponentResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ComponentResultsElement.java
@@ -203,20 +203,24 @@
}
}
-void writeStatus(DataOutputStream stream) throws IOException {
+void writeStatus(DataOutputStream stream, boolean full) throws IOException {
// Write status for scenarios having error
if ((getStatus() & ERROR_MASK) != 0) {
StringBuffer buffer = new StringBuffer(getName());
IEclipsePreferences preferences = new InstanceScope().getNode(IPerformancesConstants.PLUGIN_ID);
String comment = preferences.get(getId(), null);
if (comment != null) {
- buffer.append(" ");
+ if (full) {
+ buffer.append(" ");
+ } else {
+ buffer.append(" ");
+ }
buffer.append(comment);
}
buffer.append(Util.LINE_SEPARATOR);
stream.write(buffer.toString().getBytes());
// write status for each children
- super.writeStatus(stream);
+ super.writeStatus(stream, full);
stream.write(Util.LINE_SEPARATOR.getBytes());
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ConfigResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ConfigResultsElement.java
index 50a7ba9..7c59aee 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ConfigResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ConfigResultsElement.java
@@ -281,7 +281,7 @@
/*
* Write the element status in the given stream
*/
-void writeStatus(DataOutputStream stream) throws IOException {
+void writeStatus(DataOutputStream stream, boolean full) throws IOException {
if ((this.status & BIG_DELTA) != 0) {
ConfigResults configResults = getConfigResults();
double[] values = configResults.getConfigNumbers();
@@ -291,31 +291,34 @@
double error = values[ComponentResults.DELTA_ERROR_INDEX];
StringBuffer buffer = new StringBuffer(" ");
buffer.append(configResults.getName());
- buffer.append(" ");
- buffer.append(buildValue);
- buffer.append(" ");
- buffer.append(baselineValue);
- buffer.append(" ");
- buffer.append(buildValue-baselineValue);
- buffer.append(" ");
- buffer.append(Util.PERCENTAGE_FORMAT.format(delta));
- buffer.append(" ");
- buffer.append(Util.PERCENTAGE_FORMAT.format(error));
- double[] stats = getStatistics();
- if (stats != null) {
+ double[] stats = null;
+ if (full) {
buffer.append(" ");
- buffer.append((int) stats[0]);
+ buffer.append(buildValue);
buffer.append(" ");
- buffer.append(Util.DOUBLE_FORMAT.format(stats[1]));
+ buffer.append(baselineValue);
buffer.append(" ");
- buffer.append(Util.DOUBLE_FORMAT.format(stats[2]));
+ buffer.append(buildValue-baselineValue);
buffer.append(" ");
- buffer.append(Util.PERCENTAGE_FORMAT.format(stats[3]));
+ buffer.append(Util.PERCENTAGE_FORMAT.format(delta));
+ buffer.append(" ");
+ buffer.append(Util.PERCENTAGE_FORMAT.format(error));
+ stats = getStatistics();
+ if (stats != null) {
+ buffer.append(" ");
+ buffer.append((int) stats[0]);
+ buffer.append(" ");
+ buffer.append(Util.DOUBLE_FORMAT.format(stats[1]));
+ buffer.append(" ");
+ buffer.append(Util.DOUBLE_FORMAT.format(stats[2]));
+ buffer.append(" ");
+ buffer.append(Util.PERCENTAGE_FORMAT.format(stats[3]));
+ }
}
IEclipsePreferences preferences = new InstanceScope().getNode(IPerformancesConstants.PLUGIN_ID);
String comment = preferences.get(getId(), null);
if (comment != null) {
- if (stats == null) {
+ if (stats == null && full) {
buffer.append(" ");
}
buffer.append(" ");
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java
index d5d3f23..1c6a39d 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/PerformanceResultsElement.java
@@ -201,7 +201,7 @@
/*
* Write the component status in the given file
*/
-public boolean writeStatus(File resultsFile) {
+public boolean writeStatus(File resultsFile, boolean full) {
if (this.results == null) {
return false;
}
@@ -214,22 +214,26 @@
buffer.append("Component");
buffer.append(" Scenario");
buffer.append(" Machine");
- buffer.append(" Build ");
- buffer.append(" History ");
+ if (full) {
+ buffer.append(" Build ");
+ buffer.append(" History ");
+ }
buffer.append(" Comment");
buffer.append(Util.LINE_SEPARATOR);
- buffer.append(" value");
- buffer.append(" baseline");
- buffer.append(" variation");
- buffer.append(" delta");
- buffer.append(" error");
- buffer.append(" n");
- buffer.append(" mean");
- buffer.append(" deviation");
- buffer.append(" coeff");
- buffer.append(Util.LINE_SEPARATOR);
+ if (full) {
+ buffer.append(" value");
+ buffer.append(" baseline");
+ buffer.append(" variation");
+ buffer.append(" delta");
+ buffer.append(" error");
+ buffer.append(" n");
+ buffer.append(" mean");
+ buffer.append(" deviation");
+ buffer.append(" coeff");
+ buffer.append(Util.LINE_SEPARATOR);
+ }
stream.write(buffer.toString().getBytes());
- writeStatus(stream);
+ writeStatus(stream, full);
}
finally {
stream.close();
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ResultsElement.java
index e75a4ab..8c93a2c 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ResultsElement.java
@@ -589,10 +589,10 @@
/*
* Write the element status in the given stream
*/
-void writeStatus(DataOutputStream stream) throws IOException {
+void writeStatus(DataOutputStream stream, boolean full) throws IOException {
int length = this.children.length;
for (int i=0; i<length; i++) {
- this.children[i].writeStatus(stream);
+ this.children[i].writeStatus(stream, full);
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ScenarioResultsElement.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ScenarioResultsElement.java
index 1938be6..334a853 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ScenarioResultsElement.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/model/ScenarioResultsElement.java
@@ -128,7 +128,7 @@
}
}
-void writeStatus(DataOutputStream stream) throws IOException {
+void writeStatus(DataOutputStream stream, boolean full) throws IOException {
// Write status for scenarios having error
if ((getStatus() & ERROR_MASK) != 0) {
StringBuffer buffer = new StringBuffer(" ");
@@ -136,13 +136,17 @@
IEclipsePreferences preferences = new InstanceScope().getNode(IPerformancesConstants.PLUGIN_ID);
String comment = preferences.get(getId(), null);
if (comment != null) {
- buffer.append(" ");
+ if (full) {
+ buffer.append(" ");
+ } else {
+ buffer.append(" ");
+ }
buffer.append(comment);
}
buffer.append(Util.LINE_SEPARATOR);
stream.write(buffer.toString().getBytes());
// write status for each children
- super.writeStatus(stream);
+ super.writeStatus(stream, full);
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentResultsView.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentResultsView.java
index cddbc4b..158361d 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentResultsView.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentResultsView.java
@@ -41,6 +41,7 @@
import org.eclipse.test.internal.performance.results.model.ResultsElement;
import org.eclipse.test.internal.performance.results.model.ScenarioResultsElement;
import org.eclipse.test.internal.performance.results.utils.IPerformancesConstants;
+import org.eclipse.test.internal.performance.results.utils.Util;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
@@ -112,6 +113,7 @@
this.fullSelectionImageDescriptor = ImageDescriptor.createFromFile(getClass(), "icallout_obj.gif");
this.preferences = new InstanceScope().getNode(IPerformancesConstants.PLUGIN_ID);
this.preferences.addPreferenceChangeListener(this);
+ Util.initMilestones(this.preferences);
}
/*
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentsView.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentsView.java
index e6639e5..041f7f8 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentsView.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/ComponentsView.java
@@ -100,6 +100,7 @@
// Actions
Action filterAdvancedScenarios;
Action writeStatus;
+ Action writeFullStatus;
// SWT resources
Font boldFont;
@@ -222,6 +223,7 @@
void fillFiltersDropDown(IMenuManager manager) {
super.fillFiltersDropDown(manager);
manager.add(this.filterOldBuilds);
+ manager.add(this.filterLastBuilds);
manager.add(new Separator());
manager.add(this.filterAdvancedScenarios);
}
@@ -230,6 +232,7 @@
super.fillLocalPullDown(manager);
manager.add(new Separator());
manager.add(this.writeStatus);
+ manager.add(this.writeFullStatus);
}
/*
@@ -311,7 +314,16 @@
// Write status
this.writeStatus = new Action("Write status") {
public void run() {
- writeStatus();
+ writeStatus(false/*not full*/);
+ }
+ };
+ this.writeStatus.setEnabled(true);
+ this.writeStatus.setToolTipText("Write component status to a file");
+
+ // Write full status
+ this.writeFullStatus = new Action("Write full status") {
+ public void run() {
+ writeStatus(true/*full*/);
}
};
this.writeStatus.setEnabled(true);
@@ -426,7 +438,7 @@
}
}
-protected void writeStatus() {
+protected void writeStatus(boolean full) {
String filter = (this.resultsDir == null) ? null : this.resultsDir.getPath();
File newDir = changeDir(filter, "Select a directory to write the status");
if (newDir != null) {
@@ -437,11 +449,15 @@
newDir = new File(newDir, "all");
}
newDir.mkdir();
- File resultsFile = new File(newDir, this.results.getName()+".log");
+ if (full) {
+ newDir = new File(newDir, "full");
+ }
+ String prefix = this.results.getName();
+ File resultsFile = new File(newDir, prefix+".log");
if (resultsFile.exists()) {
int i=0;
while (true) {
- String newFileName = this.results.getName()+"_";
+ String newFileName = prefix+"_";
if (i<10) newFileName += "0";
newFileName += i+".log";
File renamedFile = new File(newDir, newFileName);
@@ -452,7 +468,7 @@
ResultsElement[] components = this.results.getChildren();
int length = components.length;
for (int i=0; i<length; i++) {
- if (!this.results.writeStatus(resultsFile)) {
+ if (!this.results.writeStatus(resultsFile, full)) {
MessageDialog.openWarning(this.shell, getTitleToolTip(), "The component is not read, hence no results can be written!");
}
}
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformanceResultsPreferencePage.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformanceResultsPreferencePage.java
index b9675bc..c7d4a88 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformanceResultsPreferencePage.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformanceResultsPreferencePage.java
@@ -61,6 +61,8 @@
private Button dbRelengRadioButton;
private Button dbLocalRadioButton;
private CCombo defaultDimensionCombo;
+// private Button lastBuildCheckBox;
+ private CCombo lastBuildCombo;
private List resultsDimensionsList;
private CCombo milestonesCombo;
private Label dbLocationLabel;
@@ -166,10 +168,22 @@
this.milestonesCombo = createCombo(compositeMilestones);
this.milestonesCombo.setToolTipText("Enter the date of the milestone as yyyymmddHHMM");
- // Default dimension layout
- StringBuffer tooltip = new StringBuffer("Select the default dimension which will be used for performance results\n");
- tooltip.append("When changed, the new selected dimension is automatically added to the dimensions list below...");
+ // Last build
+ StringBuffer tooltip = new StringBuffer("Select the last build to display performance results\n");
+ tooltip.append("If set then performance results won't be displayed for any build after this date...");
String tooltipText = tooltip.toString();
+ Composite compositeLastBuild = createComposite(parent, 3, 1);
+// this.lastBuildCheckBox = createCheckBox(compositeLastBuild, "Until last build");
+ createLabel(compositeLastBuild, "Last build: ", false);
+ this.lastBuildCombo = createCombo(compositeLastBuild);
+ this.lastBuildCombo.setEditable(false);
+ this.lastBuildCombo.setToolTipText(tooltipText);
+ initBuildsList();
+
+ // Default dimension layout
+ tooltip = new StringBuffer("Select the default dimension which will be used for performance results\n");
+ tooltip.append("When changed, the new selected dimension is automatically added to the dimensions list below...");
+ tooltipText = tooltip.toString();
Composite compositeDefaultDimension = createComposite(parent, 3, 1);
createLabel(compositeDefaultDimension, "Default dimension: ", false);
this.defaultDimensionCombo = createCombo(compositeDefaultDimension);
@@ -414,6 +428,17 @@
}
}
+/*
+ * Init he contents of the dimensions list controls.
+ */
+private void initBuildsList() {
+ String[] builds = DB_Results.getBuilds();
+ int length = builds.length;
+ for (int i=0; i<length; i++) {
+ this.lastBuildCombo.add(builds[i]);
+ }
+}
+
/**
* Initializes states of the controls using default values in the preference
* store.
@@ -456,6 +481,16 @@
milestone = store.getDefaultString(prefix + index);
}
+ // Init last build
+ String lastBuild = store.getDefaultString(PRE_LAST_BUILD);
+// if (lastBuild.length() == 0) {
+// this.lastBuildCheckBox.setSelection(false);
+// this.lastBuildCombo.setEnabled(false);
+// } else {
+// this.lastBuildCombo.setEnabled(true);
+// }
+ this.lastBuildCombo.setText(lastBuild);
+
// Init default default dimension
String defaultDimension = store.getDefaultString(PRE_DEFAULT_DIMENSION);
this.defaultDimensionCombo.setText(defaultDimension);
@@ -510,6 +545,16 @@
milestone = store.getString(prefix + index);
}
+ // Init last build
+ String lastBuild = store.getString(PRE_LAST_BUILD);
+// if (lastBuild.length() == 0) {
+// this.lastBuildCheckBox.setSelection(false);
+// this.lastBuildCombo.setEnabled(false);
+// } else {
+// this.lastBuildCombo.setEnabled(true);
+// }
+ this.lastBuildCombo.setText(lastBuild);
+
// Init composite lists
initDimensionsLists();
@@ -766,10 +811,14 @@
// Set milestones
count = this.milestonesCombo.getItemCount();
for (i=0; i<count; i++) {
- store.putValue(PRE_MILESTONE_BUILDS + version + i, this.milestonesCombo.getItem(i));
+ store.putValue(PRE_MILESTONE_BUILDS + "." + version + i, this.milestonesCombo.getItem(i));
}
Util.setMilestones(this.milestonesCombo.getItems());
+ // Set last build
+ String lastBuild = this.lastBuildCombo.getText();
+ store.putValue(PRE_LAST_BUILD, lastBuild);
+
// Set default dimension
String defaultDimension = this.defaultDimensionCombo.getText();
store.putValue(PRE_DEFAULT_DIMENSION, defaultDimension);
@@ -893,6 +942,10 @@
this.resultsDimensionsList.setSelection(resultsDimensions);
}
+// if (source == this.lastBuildCheckBox) {
+// this.lastBuildCombo.setEnabled(this.lastBuildCheckBox.getSelection());
+// }
+
if (source == this.mVersionRadioButton) {
if (this.mVersionRadioButton.getSelection()) {
updateBrowseButtonToolTip(ECLIPSE_MAINTENANCE_VERSION);
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformancesView.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformancesView.java
index aa28476..8b00dee 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformancesView.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/PerformancesView.java
@@ -48,6 +48,7 @@
import org.eclipse.test.internal.performance.results.model.BuildResultsElement;
import org.eclipse.test.internal.performance.results.model.PerformanceResultsElement;
import org.eclipse.test.internal.performance.results.utils.IPerformancesConstants;
+import org.eclipse.test.internal.performance.results.utils.Util;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewPart;
@@ -114,6 +115,16 @@
return true;
}
};
+ static String LAST_BUILD;
+ final static ViewerFilter FILTER_LAST_BUILDS = new ViewerFilter() {
+ public boolean select(Viewer v, Object parentElement, Object element) {
+ if (LAST_BUILD != null && element instanceof BuildResultsElement) {
+ BuildResultsElement buildElement = (BuildResultsElement) element;
+ return buildElement.isBefore(LAST_BUILD);
+ }
+ return true;
+ }
+ };
Set viewFilters = new HashSet();
// SWT resources
@@ -136,6 +147,7 @@
Action filterBaselineBuilds;
Action filterNightlyBuilds;
Action filterOldBuilds;
+ Action filterLastBuilds;
// Action dbConnection;
// Eclipse preferences
@@ -170,13 +182,22 @@
* The constructor.
*/
public PerformancesView() {
+
+ // Get preferences
this.preferences = new InstanceScope().getNode(IPerformancesConstants.PLUGIN_ID);
+
+ // Init db constants
int eclipseVersion = this.preferences.getInt(IPerformancesConstants.PRE_ECLIPSE_VERSION, IPerformancesConstants.DEFAULT_ECLIPSE_VERSION);
String databaseLocation = this.preferences.get(IPerformancesConstants.PRE_DATABASE_LOCATION, IPerformancesConstants.NETWORK_DATABASE_LOCATION);
boolean connected = this.preferences.getBoolean(IPerformancesConstants.PRE_DATABASE_CONNECTION, IPerformancesConstants.DEFAULT_DATABASE_CONNECTION);
DB_Results.updateDbConstants(connected, eclipseVersion, databaseLocation);
this.preferences.addPreferenceChangeListener(this);
+
+ // Init tool tip
setTitleToolTip();
+
+ // Init milestones
+ Util.initMilestones(this.preferences);
}
File changeDataDir() {
@@ -290,6 +311,19 @@
}
/*
+ * Filter non fingerprints scenarios action run.
+ */
+void filterLastBuilds(boolean filter, boolean updatePreference) {
+ if (filter) {
+ this.viewFilters.add(FILTER_LAST_BUILDS);
+ } else {
+ this.viewFilters.remove(FILTER_LAST_BUILDS);
+ }
+ this.preferences.putBoolean(IPerformancesConstants.PRE_FILTER_LAST_BUILDS, filter);
+ updateFilters();
+}
+
+/*
* Filter non milestone builds action run.
*/
void filterNightlyBuilds(boolean filter, boolean updatePreference) {
@@ -440,6 +474,20 @@
};
this.filterOldBuilds.setChecked(false);
this.filterOldBuilds.setToolTipText("Filter old builds (i.e. before last milestone) but keep all previous milestones)");
+
+ // Filter non-important builds action
+ this.filterLastBuilds = new Action("&Last Builds", IAction.AS_CHECK_BOX) {
+ public void run() {
+ filterLastBuilds(isChecked(), true/*update preference*/);
+ }
+ };
+ final String lastBuild = this.preferences.get(IPerformancesConstants.PRE_LAST_BUILD, null);
+ this.filterLastBuilds.setChecked(false);
+ if (lastBuild == null) {
+ this.filterLastBuilds.setEnabled(false);
+ } else {
+ this.filterLastBuilds.setToolTipText("Filter last builds (i.e. after "+lastBuild+" build)");
+ }
}
/* (non-Javadoc)
@@ -447,7 +495,7 @@
*/
public void preferenceChange(PreferenceChangeEvent event) {
String propertyName = event.getKey();
-// String newValue = (String) event.getNewValue();
+ String newValue = (String) event.getNewValue();
// Eclipse version change
if (propertyName.equals(IPerformancesConstants.PRE_ECLIPSE_VERSION)) {
@@ -474,6 +522,16 @@
// DB_Results.updateDbConstants(connected, eclipseVersion, databaseLocation);
// setTitleToolTip();
}
+
+ // Last build
+ if (propertyName.equals(IPerformancesConstants.PRE_LAST_BUILD)) {
+ LAST_BUILD = newValue;
+ if (newValue == null) {
+ this.filterLastBuilds.setEnabled(false);
+ } else {
+ this.filterLastBuilds.setToolTipText("Filter last builds (i.e. after "+newValue+" build)");
+ }
+ }
}
/*
@@ -550,6 +608,13 @@
if (checked) {
this.viewFilters.add(FILTER_OLD_BUILDS);
}
+
+ // Filter last builds action state
+ checked = this.preferences.getBoolean(IPerformancesConstants.PRE_FILTER_LAST_BUILDS, IPerformancesConstants.DEFAULT_FILTER_LAST_BUILDS);
+ this.filterLastBuilds.setChecked(checked);
+ if (checked) {
+ this.viewFilters.add(FILTER_LAST_BUILDS);
+ }
}
public void saveState(IMemento memento) {
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/IPerformancesConstants.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/IPerformancesConstants.java
index c30d137..c1b70f8 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/IPerformancesConstants.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/IPerformancesConstants.java
@@ -32,6 +32,7 @@
public static final String PRE_RESULTS_GENERATION_DIR = PREFIX + "results.generation.dir"; //$NON-NLS-1$
public static final String PRE_CONFIG_DESCRIPTOR_NAME = PREFIX + "config.descriptor.name"; //$NON-NLS-1$
public static final String PRE_CONFIG_DESCRIPTOR_DESCRIPTION = PREFIX + "config.descriptor.description"; //$NON-NLS-1$
+ public static final String PRE_LAST_BUILD = PREFIX + "last.build"; //$NON-NLS-1$
public static final String PRE_DEFAULT_DIMENSION = PREFIX + "default.dimension"; //$NON-NLS-1$
public static final String PRE_RESULTS_DIMENSION = PREFIX + "results.dimension"; //$NON-NLS-1$
public static final String PRE_MILESTONE_BUILDS = PREFIX + "milestone.builds"; //$NON-NLS-1$
@@ -39,6 +40,7 @@
public static final String PRE_FILTER_ADVANCED_SCENARIOS = PREFIX + "filter.non.fingerprints.scenarios"; //$NON-NLS-1$
public static final String PRE_FILTER_OLD_BUILDS = PREFIX + "filter.non.milestones.builds"; //$NON-NLS-1$
public static final String PRE_FILTER_NIGHTLY_BUILDS = PREFIX + "filter.nightly.builds"; //$NON-NLS-1$
+ public static final String PRE_FILTER_LAST_BUILDS = PREFIX + "filter.last.builds"; //$NON-NLS-1$
// Other constants
public static final int ECLIPSE_MAINTENANCE_VERSION = 35;
@@ -50,6 +52,7 @@
public static final int DEFAULT_ECLIPSE_VERSION = ECLIPSE_DEVELOPMENT_VERSION;
public static final boolean DEFAULT_FILTER_ADVANCED_SCENARIOS = true;
public static final boolean DEFAULT_FILTER_OLD_BUILDS = false;
+ public static final boolean DEFAULT_FILTER_LAST_BUILDS = false;
public static final boolean DEFAULT_FILTER_NIGHTLY_BUILDS = false;
public static final boolean DEFAULT_DATABASE_CONNECTION = false;
public static final boolean DEFAULT_DATABASE_LOCAL = false;
diff --git a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java
index 0dc5eff..912b68c 100644
--- a/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java
+++ b/bundles/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/utils/Util.java
@@ -29,6 +29,7 @@
import java.util.Locale;
import java.util.StringTokenizer;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.test.internal.performance.results.db.BuildResults;
import org.eclipse.test.internal.performance.results.db.DB_Results;
@@ -508,4 +509,27 @@
public static void setMilestones(String[] items) {
MILESTONES = items;
}
+
+/**
+ * Init the milestones from preferences
+ *
+ * @param preferences The preferences from which got milestones list
+ */
+public static void initMilestones(IEclipsePreferences preferences) {
+ int eclipseVersion = preferences.getInt(IPerformancesConstants.PRE_ECLIPSE_VERSION, IPerformancesConstants.DEFAULT_ECLIPSE_VERSION);
+ String prefix = IPerformancesConstants.PRE_MILESTONE_BUILDS + "." + eclipseVersion;
+ int index = 0;
+ String milestone = preferences.get(prefix + index, null);
+ String[] milestones = new String[20];
+ while (milestone != null) {
+ milestones[index] = milestone;
+ index++;
+ milestone = preferences.get(prefix + index, null);
+ }
+ int length = milestones.length;
+ if (index < length) {
+ System.arraycopy(milestones, 0, milestones = new String[index], 0, index);
+ }
+ MILESTONES = milestones;
+}
}