Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'FROMCVS/org.eclipse.test.performance/src/org')
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/CVS/Entries1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Entries2
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Entries1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Entries2
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/PerformanceMonitor.java59
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Entries2
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Entries1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Entries18
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalDimensions.java84
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalPerformanceMeter.java262
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/NullPerformanceMeter.java48
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeter.java89
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeterFactory.java21
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMeterFactory.java46
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitor.java53
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorLinux.java178
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorMac.java115
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorWindows.java100
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceTestPlugin.java380
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeter.java118
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeterFactory.java21
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Assert.java173
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Entries9
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DataPoint.java58
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Dim.java110
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.java45
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.properties94
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Sample.java115
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Scalar.java39
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Unit.java166
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Entries10
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DB.java816
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DBHelpers.java333
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Report.java90
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SQL.java524
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Scenario.java230
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SummaryEntry.java43
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/TimeSeries.java71
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Variations.java122
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/View.java38
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AbsoluteBandChecker.java54
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AssertChecker.java53
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Entries9
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/EmptyEvaluator.java41
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/Evaluator.java105
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/IEvaluator.java44
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/RelativeBandChecker.java62
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsSession.java238
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsUtil.java250
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/AllTests.java29
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Entries7
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/DBTests.java247
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/PerformanceMeterFactoryTest.java28
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/SimplePerformanceMeterTest.java34
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/TestPerformanceMeter.java79
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/VariationsTests.java75
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Entries5
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Dimension.java87
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Performance.java312
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceMeter.java86
-rwxr-xr-xFROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceTestCase.java194
97 files changed, 0 insertions, 6762 deletions
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/CVS/Entries
deleted file mode 100644
index 0f148f81c..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Entries
+++ /dev/null
@@ -1 +0,0 @@
-D/eclipse////
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/CVS/Repository
deleted file mode 100644
index 37239c0c3..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/CVS/Tag
deleted file mode 100644
index e19fdb1ab..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Tv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Entries
deleted file mode 100644
index 2c9763626..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Entries
+++ /dev/null
@@ -1,2 +0,0 @@
-D/perfmsr////
-D/test////
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Repository
deleted file mode 100644
index 3220d3f27..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Tag
deleted file mode 100644
index e19fdb1ab..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Tv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Entries
deleted file mode 100644
index 8d16cd31a..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Entries
+++ /dev/null
@@ -1 +0,0 @@
-D/core////
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Repository
deleted file mode 100644
index e14998bf3..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/perfmsr
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Tag
deleted file mode 100644
index e19fdb1ab..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Tv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Entries
deleted file mode 100644
index 09ae2bd31..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Entries
+++ /dev/null
@@ -1,2 +0,0 @@
-/PerformanceMonitor.java/1.10/Mon Feb 20 15:39:46 2006//Tv20101027
-D
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Repository
deleted file mode 100644
index 64d1f886d..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/perfmsr/core
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/PerformanceMonitor.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/PerformanceMonitor.java
deleted file mode 100755
index 1f75ac2a1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/perfmsr/core/PerformanceMonitor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.perfmsr.core;
-
-
-/**
- * Some natives for PerformanceMonitorWindows.
- * (We cannot fold them into the PerformanceMonitorWindows because this would break the natives
- * and we don't want to rebuild them yet).
- */
-public class PerformanceMonitor {
-
- /**
- * ivjperf - name of the library that implements the native methods.
- */
- private static final String NATIVE_LIBRARY_NAME= "ivjperf"; //$NON-NLS-1$
-
- /**
- * Is the native library loaded? 0-don't know, 1-no, 2-yes
- */
- private static int fgIsLoaded= 0;
-
- /**
- * Answer true if the native library for this class has been successfully
- * loaded. If the load has not been attempted yet, try to load it.
- * @return true if native library has been successfully loaded
- */
- public static boolean isLoaded() {
- if (fgIsLoaded == 0) {
- try {
- System.loadLibrary(NATIVE_LIBRARY_NAME);
- fgIsLoaded= 2;
- } catch (Throwable e) {
- e.printStackTrace();
- fgIsLoaded= 1;
- }
- }
- return fgIsLoaded == 2;
- }
-
- /**
- * Calls the Windows GetPerformanceInfo function
- * @param counters any array of counters that corresponds to the Windows
- * PERFORMANCE_INFORMATION structure.
- */
- public static native void nativeGetPerformanceInfo(long[] counters);
-
- public static native boolean nativeGetPerformanceCounters(long[] counters);
-
- public static native String nativeGetUUID();
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Entries
deleted file mode 100644
index 676d22ce5..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Entries
+++ /dev/null
@@ -1,2 +0,0 @@
-D/internal////
-D/performance////
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Repository
deleted file mode 100644
index eb955a5f9..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Tag
deleted file mode 100644
index e19fdb1ab..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Tv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Entries
deleted file mode 100644
index e68cf1e63..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Entries
+++ /dev/null
@@ -1 +0,0 @@
-D/performance////
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Repository
deleted file mode 100644
index 219be871f..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/internal
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Tag
deleted file mode 100644
index e19fdb1ab..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Tv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Entries
deleted file mode 100644
index 07f530ffc..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Entries
+++ /dev/null
@@ -1,18 +0,0 @@
-D/data////
-D/db////
-D/eval////
-D/results////
-D/tests////
-/InternalDimensions.java/1.9/Mon Feb 20 15:39:46 2006//Tv20101027
-/InternalPerformanceMeter.java/1.20/Fri Nov 21 10:03:50 2008//Tv20101027
-/NullPerformanceMeter.java/1.3/Mon Feb 20 15:39:45 2006//Tv20101027
-/OSPerformanceMeter.java/1.25/Mon Feb 20 15:39:46 2006//Tv20101027
-/OSPerformanceMeterFactory.java/1.3/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceMeterFactory.java/1.3/Mon Feb 20 15:39:45 2006//Tv20101027
-/PerformanceMonitor.java/1.14/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceMonitorLinux.java/1.13/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceMonitorMac.java/1.17/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceMonitorWindows.java/1.14/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceTestPlugin.java/1.23/Tue Sep 14 07:53:06 2010//Tv20101027
-/SystemTimePerformanceMeter.java/1.12/Mon Feb 20 15:39:46 2006//Tv20101027
-/SystemTimePerformanceMeterFactory.java/1.3/Mon Feb 20 15:39:46 2006//Tv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Repository
deleted file mode 100644
index aea048c06..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/internal/performance
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalDimensions.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalDimensions.java
deleted file mode 100755
index 72b3ed964..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalDimensions.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance;
-
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Unit;
-
-/**
- * Some hard coded measurement id's.
- */
-public interface InternalDimensions {
-
-// Common:
-// OS Counters:
- Dim
- SYSTEM_TIME= new Dim(2, Unit.SECOND, 1000), // System.currentTimeMillis. "System Time"
- USED_JAVA_HEAP= new Dim(3, Unit.BYTE), // Runtime.totalMemory() - Runtime.freeMemory()
- WORKING_SET= new Dim(4, Unit.BYTE), // the working set (or on Linux the resident set). "Working Set"
-// USER_TIME= new Dim(10, Unit.SECOND, 1000), // the amount of elapsed user time. "User time"
- KERNEL_TIME= new Dim(11, Unit.SECOND, 1000), // the amount of elapsed kernel time. "Kernel time"
- CPU_TIME= new Dim(20, Unit.SECOND, 1000), // the amount of CPU time we have used so far. "CPU Time"
- INVOCATION_COUNT= new Dim(52, Unit.INVOCATION, 1); // the number of method invocations. "Invocation Count"
-
-// OS Info:
- Dim
- PHYSICAL_TOTAL= new Dim(24, Unit.BYTE), // the amount of physical memory in bytes. "Physical Memory"
- SYSTEM_CACHE= new Dim(26, Unit.BYTE); // the amount of system cache memory in bytes. "System Cache"
-
-// Windows:
-// OS Counters:
- Dim
- COMITTED= new Dim(7, Unit.BYTE), // "Committed"
- WORKING_SET_PEAK= new Dim(8, Unit.BYTE), // "Working Set Peak"
- ELAPSED_PROCESS= new Dim(9, Unit.SECOND, 1000), // "Elapsed Process"
- PAGE_FAULTS= new Dim(19), // "Page Faults"
- GDI_OBJECTS= new Dim(34), // "GDI Objects"
- USER_OBJECTS= new Dim(35), // "USER Objects"
- OPEN_HANDLES= new Dim(36), // "Open Handles"
- READ_COUNT= new Dim(38, Unit.BYTE), // "Read Count"
- WRITE_COUNT= new Dim(39, Unit.BYTE), // "Write Count"
- BYTES_READ= new Dim(40, Unit.BYTE), // "Bytes Read"
- BYTES_WRITTEN= new Dim(41, Unit.BYTE); // "Bytes Written"
-
-// OS Info:
- Dim
- COMMIT_LIMIT= new Dim(22), // "Commit Limit"
- COMMIT_PEAK= new Dim(23), // "Commit Peak"
- PHYSICAL_AVAIL= new Dim(25, Unit.BYTE), // "Physical Available"
- KERNEL_TOTAL= new Dim(27), // "Kernel Total"
- KERNEL_PAGED= new Dim(28), // "Kernel Paged"
- KERNEL_NONPAGED= new Dim(29), // "Kernel Nonpaged"
- PAGE_SIZE= new Dim(30, Unit.BYTE), // "Page Size"
- HANDLE_COUNT= new Dim(31), // "Handle Count"
- PROCESS_COUNT= new Dim(32), // "Process Count"
- THREAD_COUNT= new Dim(33), // "Thread Count"
- COMMIT_TOTAL= new Dim(37); // "Commit Total"
-
-// Linux:
-// OS Counters:
- Dim
- HARD_PAGE_FAULTS= new Dim(42), // the number of hard page faults. A page had to be fetched from disk. "Hard Page Faults"
- SOFT_PAGE_FAULTS= new Dim(43), // the number of soft page faults. A page was not fetched from disk. "Soft Page Faults"
- TRS= new Dim(44, Unit.BYTE), // the amount of memory in bytes occupied by text (i.e. code). "Text Size"
- DRS= new Dim(45, Unit.BYTE), // the amount of memory in bytes occupied by data or stack. "Data Size"
- LRS= new Dim(46, Unit.BYTE); // the amount of memory in bytes occupied by shared code. "Library Size"
-
-// OS Info:
- Dim
- USED_LINUX_MEM= new Dim(48, Unit.BYTE), // the amount of memory that Linux reports is used. From /proc/meminfo. "Used Memory"
- FREE_LINUX_MEM= new Dim(49, Unit.BYTE), // the amount of memory that Linux reports is free. From /proc/meminfo. "Free Memory"
- BUFFERS_LINUX= new Dim(50, Unit.BYTE); // the amount of memory that Linux reports is used by buffers. From /proc/meminfo. "Buffers Memory"
-
-// Mac:
-// OS Counters:
-// OS Info:
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalPerformanceMeter.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalPerformanceMeter.java
deleted file mode 100755
index 03734dceb..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/InternalPerformanceMeter.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import java.io.PrintStream;
-import java.text.MessageFormat;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Sample;
-import org.eclipse.test.internal.performance.db.DB;
-import org.eclipse.test.internal.performance.db.Variations;
-import org.eclipse.test.internal.performance.eval.StatisticsSession;
-import org.eclipse.test.internal.performance.eval.StatisticsUtil;
-import org.eclipse.test.internal.performance.eval.StatisticsUtil.Percentile;
-import org.eclipse.test.performance.Dimension;
-import org.eclipse.test.performance.PerformanceMeter;
-
-
-public abstract class InternalPerformanceMeter extends PerformanceMeter {
-
-
- private static class DimensionComparator implements Comparator {
-
- public int compare(Object o1, Object o2) {
- return ((Dim) o1).getId() - ((Dim) o2).getId();
- }
-
- }
-
- public static final int AVERAGE= -3;
- public static final int SIZE= -4;
- public static final int STDEV= -5;
- public static final int BEFORE= 0;
- public static final int AFTER= 1;
-
- protected static final String VERBOSE_PERFORMANCE_METER_PROPERTY= "InternalPrintPerformanceResults"; //$NON-NLS-1$
-
- private String fScenarioId;
-
- private String fShortName;
- private Dimension[] fSummaryDimensions;
- private boolean fSummaryIsGlobal;
- private int fCommentType;
- private String fComment;
-
-
- public InternalPerformanceMeter(String scenarioId) {
- fScenarioId= scenarioId;
- }
-
- public void dispose() {
- fScenarioId= null;
- }
-
- public abstract Sample getSample();
-
- /**
- * Answer the scenario ID.
- * @return the scenario ID
- */
- public String getScenarioName() {
- return fScenarioId;
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#commit()
- */
- public void commit() {
- Sample sample= getSample();
- if (sample != null) {
- if (fSummaryDimensions != null) {
- sample.tagAsSummary(fSummaryIsGlobal, fShortName, fSummaryDimensions, fCommentType, fComment);
- } else if (this.fComment != null) {
- sample.setComment(this.fCommentType, this.fComment);
- }
- Variations variations= PerformanceTestPlugin.getVariations();
- if (variations != null)
- DB.store(variations, sample);
- if (!DB.isActive() || System.getProperty(VERBOSE_PERFORMANCE_METER_PROPERTY) != null) {
- printSample(System.out, sample);
-// printSampleCSV(System.out, sample);
- }
- }
- }
-
- private void printSample(PrintStream ps, Sample sample) {
- ps.print("Scenario '" + getScenarioName() + "' "); //$NON-NLS-1$ //$NON-NLS-2$
- DataPoint[] dataPoints= sample.getDataPoints();
- if (dataPoints.length > 0) {
- StatisticsSession s= new StatisticsSession(dataPoints);
- Dim[] dimensions= dataPoints[0].getDimensions();
- Arrays.sort(dimensions, new DimensionComparator());
- if (dimensions.length > 0) {
- List badDimensions= new ArrayList();
- long n= s.getCount(dimensions[0]);
- MessageFormat format= new MessageFormat("({0,number,percent} in [{1}, {2}])"); //$NON-NLS-1$
-
- String spaces= " "; //$NON-NLS-1$
-
- ps.println("(average over " + n + " samples):"); //$NON-NLS-1$ //$NON-NLS-2$
- for (int i= 0; i < dimensions.length; i++) {
- Dim dimension= dimensions[i];
- double mean= s.getAverage(dimension);
-
- String nameString= " " + dimension.getName() + ":"; //$NON-NLS-1$ //$NON-NLS-2$
- String meanString= dimension.getDisplayValue(mean);
- int align= firstNonDigit(meanString);
- int endIndex = 30 - align - nameString.length();
- if (endIndex > 0) meanString= spaces.substring(0, endIndex) + meanString;
-
- align= nameString.length() + meanString.length();
-
- Percentile percentile= StatisticsUtil.T95;
- double[] confidenceInterval= s.getConfidenceInterval(dimension, percentile);
-
- StringBuffer printBuffer;
- if (n <= 2) {
- printBuffer = new StringBuffer(" (no confidence)"); //$NON-NLS-1$
- } else {
- printBuffer = new StringBuffer();
- int ns = align;
- while (ns++ < 40) printBuffer.append(' ');
- printBuffer.append(format.format(new Object[] {new Double(percentile.inside()), dimension.getDisplayValue(confidenceInterval[0]), dimension.getDisplayValue(confidenceInterval[1])}));
- }
-
- align+= printBuffer.length();
- try {
- while (align++ < 70) printBuffer.append(' ');
- printBuffer.append(checkSampleSize(s, sample, dimension));
- } catch (CoreException x) {
- badDimensions.add(dimension);
- continue;
- }
-
- ps.print(nameString);
- ps.print(meanString);
- ps.println(printBuffer);
- }
-
- if (!badDimensions.isEmpty()) {
- ps.print(" Dimensions with unusable statistical properties: "); //$NON-NLS-1$
- for (Iterator iter= badDimensions.iterator(); iter.hasNext();) {
- Dim dimension= (Dim) iter.next();
- ps.print(dimension.getName());
- if (iter.hasNext())
- ps.print(", "); //$NON-NLS-1$
- }
- ps.println();
- }
- }
- }
- ps.println();
- }
-
- private String checkSampleSize(StatisticsSession s, Sample sample, Dim dimension) throws CoreException {
- long sampleSize= s.getCount(dimension);
- double stdev= s.getStddev(dimension);
- double mean= s.getAverage(dimension);
-
- if (stdev == 0)
- return ""; //$NON-NLS-1$
-
- // measurable effect size
- // sampleSize= 16 * stdev^2 / effect^2
- double effectSize= 4 * Math.sqrt(stdev * stdev / sampleSize);
-
- double base;
- String baseName;
- if (stdev > Math.abs(mean)) {
- base= stdev;
- baseName="stdev"; //$NON-NLS-1$
- } else {
- base= Math.abs(mean);
- baseName= "mean"; //$NON-NLS-1$
- }
- double fivePercentEffect= 0.05 * base;
- long requiredSampleSizeForFivePercentEffect= Math.round(16 * stdev * stdev / fivePercentEffect / fivePercentEffect + 0.5);
-
-// if (requiredSampleSizeForFivePercentEffect > 1000 || Double.isNaN(stdev))
-// throw new CoreException(new Status(IStatus.OK, "org.eclipse.text.performance", IStatus.OK, "no message", null)); //$NON-NLS-1$ //$NON-NLS-2$
-
- NumberFormat numberInstance= NumberFormat.getNumberInstance();
- numberInstance.setMaximumFractionDigits(1);
- numberInstance.setMinimumFractionDigits(1);
-
- String measurableMsg= " Measurable effect: " + dimension.getDisplayValue(effectSize) + " (" + numberInstance.format(effectSize / stdev) + " SDs)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (fivePercentEffect < effectSize)
- measurableMsg += " (required sample size for an effect of 5% of " + baseName + ": " + requiredSampleSizeForFivePercentEffect + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- return measurableMsg;
- }
-
- private int firstNonDigit(String string) {
- int length= string.length();
- for (int i= 0; i < length; i++)
- if (!Character.isDigit(string.charAt(i)) && string.charAt(i) != '-' && string.charAt(i) != '.')
- return i;
- return length;
- }
-
- void printSampleCSV(PrintStream ps, Sample sample) {
- final char SEPARATOR= '\t';
- DataPoint[] dataPoints= sample.getDataPoints();
- if (dataPoints.length > 0) {
- Dim[] dimensions= dataPoints[0].getDimensions();
- Arrays.sort(dimensions, new DimensionComparator());
- if (dimensions.length > 0) {
- /* print dimensions */
- for (int d= 0; d < dimensions.length; d++) {
- Dim dimension= dimensions[d];
- ps.print(dimension.getName());
- ps.print(SEPARATOR);
- }
- ps.println("scenario"); //$NON-NLS-1$
-
- for (int p= 0; p < dataPoints.length - 1; p+=2) {
- DataPoint before= dataPoints[p];
- DataPoint after= dataPoints[p + 1];
- for (int d= 0; d < dimensions.length; d++) {
- Dim dimension= dimensions[d];
- long valBefore= before.getScalar(dimension).getMagnitude();
- long valAfter= after.getScalar(dimension).getMagnitude();
- ps.print(valAfter - valBefore);
- ps.print(SEPARATOR);
- }
- ps.print(sample.getShortname() != null ? sample.getShortname() : sample.getScenarioID());
- ps.println();
- }
-
- ps.println();
- }
- }
- }
-
- public void tagAsSummary(boolean global, String shortName, Dimension[] dims) {
- fSummaryIsGlobal= global;
- fShortName= shortName;
- fSummaryDimensions= dims;
- }
-
- public void setComment(int commentType, String comment) {
- fCommentType= commentType;
- fComment= comment;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/NullPerformanceMeter.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/NullPerformanceMeter.java
deleted file mode 100755
index c1a9043b3..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/NullPerformanceMeter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import org.eclipse.test.performance.PerformanceMeter;
-
-/**
- * Null performance meter.
- */
-public class NullPerformanceMeter extends PerformanceMeter {
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#start()
- */
- public void start() {
- // do nothing
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#stop()
- */
- public void stop() {
- // do nothing
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#commit()
- */
- public void commit() {
- // do nothing
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#dispose()
- */
- public void dispose() {
- // do nothing
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeter.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeter.java
deleted file mode 100755
index aae45069d..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Sample;
-
-
-/**
- * Performance meter that makes its measurements with OS functionality.
- */
-public class OSPerformanceMeter extends InternalPerformanceMeter {
-
- private PerformanceMonitor fPerformanceMonitor;
- private long fStartTime;
- private List fDataPoints= new ArrayList();
-
- /**
- * @param scenarioId the scenario id
- */
- public OSPerformanceMeter(String scenarioId) {
- super(scenarioId);
- fPerformanceMonitor= PerformanceMonitor.getPerformanceMonitor();
- fStartTime= System.currentTimeMillis();
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#dispose()
- */
- public void dispose() {
- fPerformanceMonitor= null;
- fDataPoints= null;
- super.dispose();
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#start()
- */
- public void start() {
- snapshot(BEFORE);
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#stop()
- */
- public void stop() {
- snapshot(AFTER);
- }
-
- /*
- * @see org.eclipse.test.internal.performance.InternalPerformanceMeter#getSample()
- */
- public Sample getSample() {
- if (fDataPoints != null) {
- HashMap runProperties= new HashMap();
- collectRunInfo(runProperties);
- return new Sample(getScenarioName(), fStartTime, runProperties, (DataPoint[]) fDataPoints.toArray(new DataPoint[fDataPoints.size()]));
- }
- return null;
- }
-
- //---- private stuff ------
-
- private void snapshot(int step) {
- HashMap map= new HashMap();
- fPerformanceMonitor.collectOperatingSystemCounters(map);
- fDataPoints.add(new DataPoint(step, map));
- }
-
- /**
- * Write out the run element if it hasn't been written out yet.
- * @param runProperties
- */
- private void collectRunInfo(HashMap runProperties) {
- fPerformanceMonitor.collectGlobalPerformanceInfo(runProperties);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeterFactory.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeterFactory.java
deleted file mode 100755
index 35ef8f86a..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/OSPerformanceMeterFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import org.eclipse.test.performance.PerformanceMeter;
-
-public class OSPerformanceMeterFactory extends PerformanceMeterFactory {
-
- protected PerformanceMeter doCreatePerformanceMeter(String scenario) {
- return new OSPerformanceMeter(scenario);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMeterFactory.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMeterFactory.java
deleted file mode 100755
index b69c4e6fd..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMeterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.test.performance.Performance;
-import org.eclipse.test.performance.PerformanceMeter;
-
-import junit.framework.TestCase;
-
-public abstract class PerformanceMeterFactory {
-
- private static Set fScenarios= new HashSet();
-
- public PerformanceMeter createPerformanceMeter(String scenario) {
- assertUniqueScenario(scenario);
- return doCreatePerformanceMeter(scenario);
- }
-
- public PerformanceMeter createPerformanceMeter(TestCase testCase, String monitorId) {
- return createPerformanceMeter(Performance.getDefault().getDefaultScenarioId(testCase, monitorId));
- }
-
- public PerformanceMeter createPerformanceMeter(TestCase testCase) {
- return createPerformanceMeter(Performance.getDefault().getDefaultScenarioId(testCase));
- }
-
- protected abstract PerformanceMeter doCreatePerformanceMeter(String scenario);
-
- private static void assertUniqueScenario(String scenario) {
- if (fScenarios.contains(scenario))
- throw new IllegalArgumentException();
- fScenarios.add(scenario);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitor.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitor.java
deleted file mode 100755
index 7ad757d19..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance;
-
-import java.util.Map;
-
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Scalar;
-
-
-class PerformanceMonitor {
-
- private static PerformanceMonitor fgPerformanceMonitor;
-
- public static PerformanceMonitor getPerformanceMonitor() {
- if (fgPerformanceMonitor == null) {
- String os= System.getProperty("os.name"); //$NON-NLS-1$
- if (os.startsWith("Windows")) //$NON-NLS-1$
- fgPerformanceMonitor= new PerformanceMonitorWindows();
- else if (os.startsWith("Mac OS X")) //$NON-NLS-1$
- fgPerformanceMonitor= new PerformanceMonitorMac();
- else
- fgPerformanceMonitor= new PerformanceMonitorLinux();
- }
- return fgPerformanceMonitor;
- }
-
- protected void collectOperatingSystemCounters(Map scalars) {
- if (PerformanceTestPlugin.isOldDB()) {
- addScalar(scalars, InternalDimensions.SYSTEM_TIME, System.currentTimeMillis());
- } else {
- Runtime runtime= Runtime.getRuntime();
- //runtime.gc();
- addScalar(scalars, InternalDimensions.USED_JAVA_HEAP, runtime.totalMemory() - runtime.freeMemory());
- }
- }
-
- protected void collectGlobalPerformanceInfo(Map scalars) {
- // no default implementation
- }
-
- void addScalar(Map scalars, Dim dimension, long value) {
- scalars.put(dimension, new Scalar(dimension, value));
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorLinux.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorLinux.java
deleted file mode 100755
index a16a11473..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorLinux.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-class PerformanceMonitorLinux extends PerformanceMonitor {
-
- private static long PAGESIZE= 4096;
- private static long JIFFIES= 10L;
- private static boolean fgHasElapsedTime= true;
- private static long fgStartupTime;
-
- /**
- * Write out operating system counters for Linux.
- * @param scalars
- */
- protected void collectOperatingSystemCounters(Map scalars) {
- synchronized(this) {
- /**
- * The status values for a Linux process, that is the values that come from /proc/self/stat.
- * The names of the variables match the man proc page.
- */
- StringTokenizer st= readTokens("/proc/self/stat", false); //$NON-NLS-1$
- if (st != null) {
- st.nextToken(); // int pid; // Process id.
- st.nextToken(); // String comm; // The command name.
- st.nextToken(); // String state;
- st.nextToken(); // int ppid; // Parent process id. */
- st.nextToken(); // int pgrp; // Process group. */
- st.nextToken(); // int session;
- st.nextToken(); // int ttry_nr;
- st.nextToken(); // int tpgid;
- st.nextToken(); // long flags;
- long minflt = Long.parseLong(st.nextToken()); // Minor page faults (didn't need to load a page from disk). */
- st.nextToken(); // long cminflt; // Minor page faults for the process and it's children. */
- long majflt = Long.parseLong(st.nextToken()); // Major page faults. */
- st.nextToken(); // long cmajflt; // Major page faults for the process and it's children. */
- long utime = Long.parseLong(st.nextToken()); // User time in jiffies. */
- long stime = Long.parseLong(st.nextToken()); // System time in jiffies. */
- st.nextToken(); // long cutime; // User time for the process and it's children. */
- st.nextToken(); // long cstime; // System time for the process and it's children. */
-
- //addScalar(scalars, InternalDimensions.USER_TIME, utime*JIFFIES);
- addScalar(scalars, InternalDimensions.KERNEL_TIME, stime*JIFFIES);
- addScalar(scalars, InternalDimensions.CPU_TIME, (utime+stime)*JIFFIES);
- addScalar(scalars, InternalDimensions.SOFT_PAGE_FAULTS, minflt);
- addScalar(scalars, InternalDimensions.HARD_PAGE_FAULTS, majflt);
- }
-
- /**
- * The status memory values values for a Linux process, that is the values that come from /proc/self/statm.
- * The names of the variables match the man proc page.
- */
- st= readTokens("/proc/self/statm", false); //$NON-NLS-1$
- if (st != null) {
- st.nextToken(); // int size; // Size of the process in pages
- int resident= Integer.parseInt(st.nextToken()); // Resident size in pages.
- st.nextToken(); // int shared; // Shared size in pages.
- int trs= Integer.parseInt(st.nextToken()); // Text (code) size in pages.
- int drs= Integer.parseInt(st.nextToken()); // Data/Stack size in pages.
- int lrs= Integer.parseInt(st.nextToken()); // Library size in pages.
- // st.nextToken(); // int dt; // Dirty pages.
-
- addScalar(scalars, InternalDimensions.WORKING_SET, resident*PAGESIZE);
- addScalar(scalars, InternalDimensions.TRS, trs*PAGESIZE);
- addScalar(scalars, InternalDimensions.DRS, drs*PAGESIZE);
- addScalar(scalars, InternalDimensions.LRS, lrs*PAGESIZE);
- }
-
- long currentTime= System.currentTimeMillis();
- if (!PerformanceTestPlugin.isOldDB())
- addScalar(scalars, InternalDimensions.SYSTEM_TIME, currentTime);
-
- if (fgHasElapsedTime) {
- if (fgStartupTime == 0) {
- String t= System.getProperty("eclipse.startTime"); //$NON-NLS-1$
- if (t != null) {
- try {
- fgStartupTime= Long.parseLong(t);
- } catch (NumberFormatException e) {
- fgHasElapsedTime= false;
- }
- } else
- fgHasElapsedTime= false;
- }
- if (fgHasElapsedTime)
- addScalar(scalars, InternalDimensions.ELAPSED_PROCESS, currentTime-fgStartupTime);
- }
-
- super.collectOperatingSystemCounters(scalars);
- }
- }
-
- /**
- * Write out the global machine counters for Linux.
- * @param scalars
- */
- protected void collectGlobalPerformanceInfo(Map scalars) {
- synchronized(this) {
- /**
- * The meminfo values for a Linux machine, that is the values that come from /proc/meminfo.
- */
- // /proc/meminfo is formatted on linux - use byte-counted output from free
- StringTokenizer st= readOutput("free -b", true); //$NON-NLS-1$
- if (st != null) {
- st.nextToken(); // throw away label
- long total= Long.parseLong(st.nextToken());
- long used= Long.parseLong(st.nextToken());
- long free= Long.parseLong(st.nextToken());
- st.nextToken(); // long shared;
- long buffers= Long.parseLong(st.nextToken());
- long cache= Long.parseLong(st.nextToken());
-
- addScalar(scalars, InternalDimensions.PHYSICAL_TOTAL, total);
- addScalar(scalars, InternalDimensions.USED_LINUX_MEM, used);
- addScalar(scalars, InternalDimensions.FREE_LINUX_MEM, free);
- addScalar(scalars, InternalDimensions.BUFFERS_LINUX, buffers);
- addScalar(scalars, InternalDimensions.SYSTEM_CACHE, cache);
- }
- super.collectGlobalPerformanceInfo(scalars);
- }
- }
-
- private StringTokenizer readTokens(String procPath, boolean skipFirst) {
- BufferedReader rdr= null;
- try {
- rdr= new BufferedReader(new FileReader(procPath));
- if (skipFirst)
- rdr.readLine(); // throw away the heading line
- return new StringTokenizer(rdr.readLine());
- } catch (IOException e) {
- PerformanceTestPlugin.log(e);
- } finally {
- try {
- if (rdr != null)
- rdr.close();
- } catch (IOException e) {
- // silently ignored
- }
- }
- return null;
- }
-
- private StringTokenizer readOutput(String cmd, boolean skipFirst) {
- BufferedReader rdr= null;
- try {
- Process process= Runtime.getRuntime().exec(cmd);
- rdr= new BufferedReader(new InputStreamReader(process.getInputStream()));
- if (skipFirst)
- rdr.readLine(); // throw away the heading line
- return new StringTokenizer(rdr.readLine());
- } catch (IOException e) {
- PerformanceTestPlugin.log(e);
- } finally {
- try {
- if (rdr != null)
- rdr.close();
- } catch (IOException e) {
- // silently ignored
- }
- }
- return null;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorMac.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorMac.java
deleted file mode 100755
index f1fee451f..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorMac.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance;
-
-import java.util.Map;
-
-/**
- * The Mac OS X version of the performance monitor.
- * (Uses default implementation for now).
- */
-class PerformanceMonitorMac extends PerformanceMonitor {
-
- private static boolean fgHasElapsedTime= true;
- private static long fgStartupTime;
-
- /**
- * name of the library that implements the native methods.
- */
- private static final String NATIVE_LIBRARY_NAME= "perf_3_1_0"; //$NON-NLS-1$
-
- /**
- * Is the native library loaded? 0-don't know, 1-no, 2-yes
- */
- private static int fgIsLoaded= 0;
-
- /**
- * Answer true if the native library for this class has been successfully
- * loaded. If the load has not been attempted yet, try to load it.
- * @return returns true if native library has been successfullz loaded
- */
- public static boolean isLoaded() {
- if (fgIsLoaded == 0) {
- try {
- System.loadLibrary(NATIVE_LIBRARY_NAME);
- fgIsLoaded= 2;
- } catch (Throwable e) {
- //e.printStackTrace();
- //PerformanceTestPlugin.log(e);
- fgIsLoaded= 1;
- }
- }
- return fgIsLoaded == 2;
- }
-
-
- /**
- * Write out operating system counters for Mac OS X.
- * @param scalars where to collect the data
- */
- protected void collectOperatingSystemCounters(Map scalars) {
- synchronized(this) {
- if (isLoaded()) {
- int[] counters= new int[18];
- if (getrusage(0, counters) == 0) {
-
- int user_time= counters[0]*1000 + counters[1]/1000;
- int kernel_time= counters[2]*1000 + counters[3]/1000;
-
- addScalar(scalars, InternalDimensions.KERNEL_TIME, kernel_time);
- addScalar(scalars, InternalDimensions.CPU_TIME, user_time + kernel_time);
- }
- }
-
- long currentTime= System.currentTimeMillis();
- if (!PerformanceTestPlugin.isOldDB())
- addScalar(scalars, InternalDimensions.SYSTEM_TIME, currentTime);
-
- if (fgHasElapsedTime) {
- if (fgStartupTime == 0) {
- String t= System.getProperty("eclipse.startTime"); //$NON-NLS-1$
- if (t != null) {
- try {
- fgStartupTime= Long.parseLong(t);
- } catch (NumberFormatException e) {
- fgHasElapsedTime= false;
- }
- } else
- fgHasElapsedTime= false;
- }
- if (fgHasElapsedTime)
- addScalar(scalars, InternalDimensions.ELAPSED_PROCESS, currentTime-fgStartupTime);
- }
-
- super.collectOperatingSystemCounters(scalars);
- }
- }
-
-// struct rusage {
-// 0,1 struct timeval ru_utime; /* user time used */
-// 2,3 struct timeval ru_stime; /* system time used */
-// 4 long ru_maxrss; /* integral max resident set size */
-// 5 long ru_ixrss; /* integral shared text memory size */
-// 6 long ru_idrss; /* integral unshared data size */
-// 7 long ru_isrss; /* integral unshared stack size */
-// 8 long ru_minflt; /* page reclaims */
-// 9 long ru_majflt; /* page faults */
-// 10 long ru_nswap; /* swaps */
-// 11 long ru_inblock; /* block input operations */
-// 12 long ru_oublock; /* block output operations */
-// 13 long ru_msgsnd; /* messages sent */
-// 14 long ru_msgrcv; /* messages received */
-// 15 long ru_nsignals; /* signals received */
-// 16 long ru_nvcsw; /* voluntary context switches */
-// 17 long ru_nivcsw; /* involuntary context switches */
-// };
- private static native int getrusage(int who, int[] counters);
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorWindows.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorWindows.java
deleted file mode 100755
index b7bc861ec..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceMonitorWindows.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance;
-
-import java.util.Map;
-
-import org.eclipse.test.internal.performance.PerformanceMonitor;
-
-/**
- * The PerformanceMonitor for Windows.
- */
-class PerformanceMonitorWindows extends PerformanceMonitor {
-
-
- private boolean fgNativeGetPerformanceInfoNotAvailable;
-
- protected void collectOperatingSystemCounters(Map scalars) {
- synchronized(this) {
- if (org.eclipse.perfmsr.core.PerformanceMonitor.isLoaded()) {
- long[] counters= new long[14];
- if (org.eclipse.perfmsr.core.PerformanceMonitor.nativeGetPerformanceCounters(counters)) {
- addScalar(scalars, InternalDimensions.WORKING_SET, counters[0]);
- addScalar(scalars, InternalDimensions.WORKING_SET_PEAK, counters[1]);
- addScalar(scalars, InternalDimensions.ELAPSED_PROCESS, counters[2]);
- //addScalar(scalars, InternalDimensions.USER_TIME, counters[3]);
- addScalar(scalars, InternalDimensions.KERNEL_TIME, counters[4]);
- addScalar(scalars, InternalDimensions.CPU_TIME, counters[3] + counters[4]);
- addScalar(scalars, InternalDimensions.PAGE_FAULTS, counters[5]);
- if (counters[6] != -1)
- addScalar(scalars, InternalDimensions.COMITTED, counters[6]);
- addScalar(scalars, InternalDimensions.GDI_OBJECTS, counters[7]);
- //addScalar(scalars, Dimensions.USER_OBJECTS, counters[8]);
- //if (counters[9] != -1)
- // addScalar(scalars, InternalDimensions.OPEN_HANDLES, counters[9]);
- //addScalar(scalars, InternalDimensions.READ_COUNT, counters[10]);
- //addScalar(scalars, InternalDimensions.WRITE_COUNT, counters[11]);
- //addScalar(scalars, InternalDimensions.BYTES_READ, counters[12]);
- //addScalar(scalars, InternalDimensions.BYTES_WRITTEN, counters[13]);
- }
- }
- super.collectOperatingSystemCounters(scalars);
- }
- }
-
- /**
- * Collect global performance info. This includes things like the total
- * committed memory for the entire system.
- *
- * This function depends on the GetPerformanceInfo() function being available in
- * the Windows ivjperf.dll. This is available in XP but is usually not available
- * in Win2000. If it is not available then this function throws an UnsupportedOperationException.
- * @param scalars
- */
- protected void collectGlobalPerformanceInfo(Map scalars) {
- synchronized(this) {
- if (!fgNativeGetPerformanceInfoNotAvailable && org.eclipse.perfmsr.core.PerformanceMonitor.isLoaded()) {
- long[] counters= new long[13];
- try {
- org.eclipse.perfmsr.core.PerformanceMonitor.nativeGetPerformanceInfo(counters);
- long pageSize= counters[9];
- addScalar(scalars, InternalDimensions.COMMIT_TOTAL, counters[0]*pageSize);
- addScalar(scalars, InternalDimensions.COMMIT_LIMIT, counters[1]*pageSize);
- addScalar(scalars, InternalDimensions.COMMIT_PEAK, counters[2]*pageSize);
- addScalar(scalars, InternalDimensions.PHYSICAL_TOTAL, counters[3]*pageSize);
- addScalar(scalars, InternalDimensions.PHYSICAL_AVAIL, counters[4]*pageSize);
- addScalar(scalars, InternalDimensions.SYSTEM_CACHE, counters[5]*pageSize);
- addScalar(scalars, InternalDimensions.KERNEL_TOTAL, counters[6]*pageSize);
- addScalar(scalars, InternalDimensions.KERNEL_PAGED, counters[7]*pageSize);
- addScalar(scalars, InternalDimensions.KERNEL_NONPAGED, counters[8]*pageSize);
- addScalar(scalars, InternalDimensions.PAGE_SIZE, counters[9]);
- addScalar(scalars, InternalDimensions.HANDLE_COUNT, counters[10]);
- addScalar(scalars, InternalDimensions.PROCESS_COUNT, counters[11]);
- addScalar(scalars, InternalDimensions.THREAD_COUNT, counters[12]);
- } catch (Exception e) {
- PerformanceTestPlugin.logWarning("native function GetPerformanceInfo() not available on this version of Windows"); //$NON-NLS-1$
- fgNativeGetPerformanceInfoNotAvailable= true;
- }
- }
- super.collectGlobalPerformanceInfo(scalars);
- }
- }
-
-// protected String getUUID() {
-// if (org.eclipse.perfmsr.core.PerformanceMonitor.isLoaded()) {
-// try {
-// return org.eclipse.perfmsr.core.PerformanceMonitor.nativeGetUUID();
-// } catch (Exception e) {
-// }
-// }
-// return super.getUUID();
-// }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceTestPlugin.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceTestPlugin.java
deleted file mode 100755
index a2f8279b2..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/PerformanceTestPlugin.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.db.DB;
-import org.eclipse.test.internal.performance.db.Variations;
-import org.eclipse.test.performance.Dimension;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * @since 3.1
- */
-public class PerformanceTestPlugin extends Plugin {
-
- public static final String CONFIG= "config"; //$NON-NLS-1$
- public static final String BUILD= "build"; //$NON-NLS-1$
-
- private static final String DEFAULT_DB_NAME= "perfDB"; //$NON-NLS-1$
- private static final String DEFAULT_DB_USER= "guest"; //$NON-NLS-1$
- private static final String DEFAULT_DB_PASSWORD= "guest"; //$NON-NLS-1$
-
- private static final String DB_NAME= "dbname"; //$NON-NLS-1$
- private static final String DB_USER= "dbuser"; //$NON-NLS-1$
- private static final String DB_PASSWD= "dbpasswd"; //$NON-NLS-1$
-
- /*
- * New properties
- */
- private static final String ECLIPSE_PERF_DBLOC = "eclipse.perf.dbloc"; //$NON-NLS-1$
- private static final String ECLIPSE_PERF_ASSERTAGAINST = "eclipse.perf.assertAgainst"; //$NON-NLS-1$
- private static final String ECLIPSE_PERF_CONFIG = "eclipse.perf.config"; //$NON-NLS-1$
- private static final String ECLIPSE_PERF_DEFAULT_DIM = "eclipse.perf.default.dim"; //$NON-NLS-1$
- private static final String ECLIPSE_PERF_RESULTS_DIMENSIONS = "eclipse.perf.results.dimensions"; //$NON-NLS-1$
- private static final String ECLIPSE_PERF_CONFIGS_DESCRIPTOR = "eclipse.perf.configs.descriptor"; //$NON-NLS-1$
-
- /**
- * Supported dimensions.
- * <p>
- * Currently all the dimensions accessible through this interface:
- * <ul>
- * <li>{@link Dimension#KERNEL_TIME}</li>
- * <li>{@link Dimension#CPU_TIME}</li>
- * <li>{@link Dimension#WORKING_SET}</li>
- * <li>{@link Dimension#ELAPSED_PROCESS}</li>
- * <li>{@link Dimension#USED_JAVA_HEAP}</li>
- * <li>{@link Dimension#WORKING_SET_PEAK}</li>
- * <li>{@link Dimension#KERNEL_TIME}</li>
- * </ul>
- * </p>
- */
- private static final Dim[] SUPPORTED_DIMENSIONS = {
- InternalDimensions.KERNEL_TIME,
- InternalDimensions.CPU_TIME,
- InternalDimensions.WORKING_SET,
- InternalDimensions.ELAPSED_PROCESS,
- InternalDimensions.USED_JAVA_HEAP,
- InternalDimensions.WORKING_SET_PEAK,
- InternalDimensions.COMITTED,
- };
-
- /**
- * Identifiers of the supported dimensions.
- */
- private static final int[] SUPPORTED_DIMENSIONS_ID = new int[SUPPORTED_DIMENSIONS.length];
- static {
- int length = SUPPORTED_DIMENSIONS.length;
- for (int i = 0; i < length; i++) {
- SUPPORTED_DIMENSIONS_ID[i] = SUPPORTED_DIMENSIONS[i].getId();
- }
- }
-
- /**
- * Default machines names.
- */
- private static final String DEFAULT_CONFIG_DESCRIPTORS =
- "eplnx1,SLED 10 Sun 1.6.0_17 (2 x 3.00GHz - 3GB RAM); " + //$NON-NLS-1$
- "eplnx2,RHEL 5.0 Sun 6.0_04 (2 x 3.00GHz - 3GB RAM); " + //$NON-NLS-1$
- "epwin2,Win XP Sun 1.6.0_17 (2 x 3.00GHz - 3GB RAM); " + //$NON-NLS-1$
- "epwin3,Win XP Sun 6.0_17 (2 x 3.00GHz - 3GB RAM);"; //$NON-NLS-1$
-
- /**
- * Default dimension use for performance results.
- */
- private static final Dim DEFAULT_DIMENSION = InternalDimensions.ELAPSED_PROCESS;
-
- /**
- * The dimensions which are put in the generated performance results pages.
- */
- private static final Dim[] DEFAULT_RESULTS_DIMENSIONS = {
- InternalDimensions.ELAPSED_PROCESS,
- InternalDimensions.CPU_TIME,
- };
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID= "org.eclipse.test.performance"; //$NON-NLS-1$
-
- /** Status code describing an internal error */
- public static final int INTERNAL_ERROR= 1;
-
- /**
- * The shared instance.
- */
- private static PerformanceTestPlugin fgPlugin;
-
- /* temporary code */
- private static boolean fgOldDBInitialized;
- private static boolean fgOldDB; // true if we are talking to the old perfDB in Ottawa
-
- /**
- * The constructor.
- */
- public PerformanceTestPlugin() {
- super();
- fgPlugin= this;
- }
-
- static boolean isOldDB() {
- if (!fgOldDBInitialized) {
- String loc= getDBLocation();
- if (loc != null && loc.indexOf("relengbuildserv") >= 0) //$NON-NLS-1$
- fgOldDB= true;
- fgOldDBInitialized= true;
- }
- return fgOldDB;
- }
-
- public void stop(BundleContext context) throws Exception {
- DB.shutdown();
- super.stop(context);
- }
-
- /*
- * Returns the shared instance.
- */
- public static PerformanceTestPlugin getDefault() {
- return fgPlugin;
- }
-
- /*
- * -Declipse.perf.dbloc=net://localhost
- */
- public static String getDBLocation() {
- String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
- if (dbloc != null) {
- Variations keys= new Variations();
- keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
- return keys.getProperty(ECLIPSE_PERF_DBLOC);
- }
- return null;
- }
-
- public static String getDBName() {
- String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
- if (dbloc != null) {
- Variations keys= new Variations();
- keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
- return keys.getProperty(DB_NAME, DEFAULT_DB_NAME);
- }
- return DEFAULT_DB_NAME;
- }
-
- public static String getDBUser() {
- String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
- if (dbloc != null) {
- Variations keys= new Variations();
- keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
- return keys.getProperty(DB_USER, DEFAULT_DB_USER);
- }
- return DEFAULT_DB_USER;
- }
-
- /**
- * Returns the default dimension used for performance results.
- *
- * @return The default {@link Dimension} or <code>null</code> if the specified default dimension
- * does not match any known dimensions name.
- */
- public static Dimension getDefaultDimension() {
- String defaultDim = System.getProperty(ECLIPSE_PERF_DEFAULT_DIM);
- if (defaultDim == null) return DEFAULT_DIMENSION;
- Dimension dimension = getDimension(defaultDim);
- Assert.isNotNull(dimension, "Invalid default dimension found in system property '"+ECLIPSE_PERF_DEFAULT_DIM+"': "+defaultDim); //$NON-NLS-1$ //$NON-NLS-2$
- return dimension;
- }
-
- /**
- * Returns the dimensions displayed in the performance results.
- *
- * @return The list of {@link Dimension} which will be displayed in the generated results data pages.
- */
- public static Dimension[] getResultsDimensions() {
- String resultsDimension = System.getProperty(ECLIPSE_PERF_RESULTS_DIMENSIONS);
- if (resultsDimension == null) return DEFAULT_RESULTS_DIMENSIONS;
- StringTokenizer tokenizer = new StringTokenizer(resultsDimension, ","); //$NON-NLS-1$
- List list = new ArrayList();
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken().trim();
- Dimension dimension = getDimension(token);
- if (dimension == null) {
- try {
- dimension = getDimension(Integer.parseInt(token));
- } catch (NumberFormatException e) {
- // skip
- }
- if (dimension == null) {
- System.err.println("Skip invalid results dimension found in system property '"+ECLIPSE_PERF_RESULTS_DIMENSIONS+"': "+resultsDimension); //$NON-NLS-1$ //$NON-NLS-2$
- continue;
- }
- }
- list.add(dimension);
- }
- int size = list.size();
- if (size == 0) {
- System.err.println("No valid dimension was found in system property '"+ECLIPSE_PERF_RESULTS_DIMENSIONS+"'!"); //$NON-NLS-1$ //$NON-NLS-2$
- System.err.println("=> default results dimensions will be used instead!"); //$NON-NLS-1$
- return DEFAULT_RESULTS_DIMENSIONS;
- }
- Dimension[] dimensions = new Dimension[size];
- list.toArray(dimensions);
- return dimensions;
- }
-
- /**
- * Returns the names of the dimensions which may be used in the performance results.
- *
- * @return The list of the dimension names
- */
- public static List getDimensions() {
- List dimensions = new ArrayList();
- for (int i = 0; i < SUPPORTED_DIMENSIONS.length; i++) {
- dimensions.add(SUPPORTED_DIMENSIONS[i].getName());
- }
- return dimensions;
- }
-
- /**
- * Return the dimension corresponding to the given id.
- *
- * @param id The id of the searched dimension.
- * @return The {@link Dimension} or <code>null</code> if none is found.
- */
- public static Dimension getDimension(int id) {
- int length = SUPPORTED_DIMENSIONS.length;
- for (int i = 0; i < length; i++) {
- if (SUPPORTED_DIMENSIONS[i].getId() == id) {
- return SUPPORTED_DIMENSIONS[i];
- }
- }
- return null;
- }
-
- /**
- * Return the dimension corresponding to the given id.
- *
- * @param name The name of the searched dimension.
- * @return The {@link Dimension} or <code>null</code> if none is found.
- */
- public static Dimension getDimension(String name) {
- int length = SUPPORTED_DIMENSIONS.length;
- for (int i = 0; i < length; i++) {
- if (SUPPORTED_DIMENSIONS[i].getName().equals(name)) {
- return SUPPORTED_DIMENSIONS[i];
- }
- }
- return null;
- }
-
- /**
- * Return the descriptors of the configurations used for the performances.
- *
- * @return An array of 2 strings, the former is the name of the configuration and the latter its description.
- */
- public static String[][] getConfigDescriptors() {
- String descriptors = System.getProperty(ECLIPSE_PERF_CONFIGS_DESCRIPTOR, DEFAULT_CONFIG_DESCRIPTORS);
- StringTokenizer tokenizer = new StringTokenizer(descriptors, ",;"); //$NON-NLS-1$
- List list = new ArrayList();
- while (tokenizer.hasMoreTokens()) {
- String[] config = new String[2];
- config[0] = tokenizer.nextToken().trim(); // config name
- config[1] = tokenizer.nextToken().trim(); // config description
- list.add(config);
- }
- String[][] configDescriptors = new String[list.size()][];
- list.toArray(configDescriptors);
- return configDescriptors;
- }
-
- public static String getDBPassword() {
- String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
- if (dbloc != null) {
- Variations keys= new Variations();
- keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
- return keys.getProperty(DB_PASSWD, DEFAULT_DB_PASSWORD);
- }
- return DEFAULT_DB_PASSWORD;
- }
-
- /*
- * -Declipse.perf.config=<varname1>=<varval1>;<varname2>=<varval2>;...;<varnameN>=<varvalN>
- */
- public static Variations getVariations() {
- Variations keys= new Variations();
- String configKey= System.getProperty(ECLIPSE_PERF_CONFIG);
- if (configKey != null)
- keys.parsePairs(configKey);
- return keys;
- }
-
- /*
- * -Declipse.perf.assertAgainst=<varname1>=<varval1>;<varname2>=<varval2>;...;<varnameN>=<varvalN>
- * Returns null if assertAgainst property isn't defined.
- */
- public static Variations getAssertAgainst() {
- String assertKey= System.getProperty(ECLIPSE_PERF_ASSERTAGAINST);
- if (assertKey != null) {
- Variations keys= getVariations();
- if (keys == null)
- keys= new Variations();
- keys.parsePairs(assertKey);
- return keys;
- }
- return null;
- }
-
- // logging
-
- public static void logError(String message) {
- if (message == null)
- message= ""; //$NON-NLS-1$
- log(new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR, message, null));
- }
-
- public static void logWarning(String message) {
- if (message == null)
- message= ""; //$NON-NLS-1$
- log(new Status(IStatus.WARNING, PLUGIN_ID, IStatus.OK, message, null));
- }
-
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR, "Internal Error", e)); //$NON-NLS-1$
- }
-
- public static void log(IStatus status) {
- if (fgPlugin != null) {
- fgPlugin.getLog().log(status);
- } else {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- System.err.println("Error: " + status.getMessage()); //$NON-NLS-1$
- break;
- case IStatus.WARNING:
- System.err.println("Warning: " + status.getMessage()); //$NON-NLS-1$
- break;
- }
- Throwable exception= status.getException();
- if (exception != null)
- exception.printStackTrace(System.err);
- }
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeter.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeter.java
deleted file mode 100755
index 99f748319..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeter.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.test.internal.performance.data.Assert;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Sample;
-import org.eclipse.test.internal.performance.data.Scalar;
-
-
-public class SystemTimePerformanceMeter extends InternalPerformanceMeter {
-
- private static final int DEFAULT_INITIAL_CAPACITY= 3;
-
- private long fStartDate;
- private List fStartTime;
- private List fStopTime;
-
- /**
- * @param scenarioId the scenario id
- */
- public SystemTimePerformanceMeter(String scenarioId) {
- this(scenarioId, DEFAULT_INITIAL_CAPACITY);
- fStartDate= System.currentTimeMillis();
- }
-
- /**
- * @param scenarioId the scenario id
- * @param initalCapacity the initial capacity in the number of measurments
- */
- public SystemTimePerformanceMeter(String scenarioId, int initalCapacity) {
- super(scenarioId);
- fStartTime= new ArrayList(initalCapacity);
- fStopTime= new ArrayList(initalCapacity);
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#start()
- */
- public void start() {
- fStartTime.add(new Long(System.currentTimeMillis()));
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#stop()
- */
- public void stop() {
- fStopTime.add(new Long(System.currentTimeMillis()));
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#commit()
- */
- public void commit() {
- Assert.isTrue(fStartTime.size() == fStopTime.size());
- System.out.println("Scenario: " + getScenarioName()); //$NON-NLS-1$
- int maxOccurenceLength= String.valueOf(fStartTime.size()).length();
- for (int i= 0; i < fStartTime.size(); i++) {
- String occurence= String.valueOf(i + 1);
- System.out.println("Occurence " + replicate(" ", maxOccurenceLength - occurence.length()) + occurence + ": " + (((Long) fStopTime.get(i)).longValue() - ((Long) fStartTime.get(i)).longValue())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- private String replicate(String s, int n) {
- StringBuffer buf= new StringBuffer(n * s.length());
- for (int i= 0; i < n; i++)
- buf.append(s);
- return buf.toString();
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#dispose()
- */
- public void dispose() {
- fStartTime= null;
- fStopTime= null;
- super.dispose();
- }
-
- public Sample getSample() {
- Assert.isTrue(fStartTime.size() == fStopTime.size());
-
- Map properties= new HashMap();
- /*
- properties.put(DRIVER_PROPERTY, PerformanceTestPlugin.getBuildId());
- properties.put(HOSTNAME_PROPERTY, getHostName());
- */
-
- DataPoint[] data= new DataPoint[2*fStartTime.size()];
- for (int i= 0; i < fStartTime.size(); i++) {
- data[2*i]= createDataPoint(BEFORE, InternalDimensions.SYSTEM_TIME, ((Long) fStartTime.get(i)).longValue());
- data[2*i+1]= createDataPoint(AFTER, InternalDimensions.SYSTEM_TIME, ((Long) fStopTime.get(i)).longValue());
- }
-
- return new Sample(getScenarioName(), fStartDate, properties, data);
- }
-
- private DataPoint createDataPoint(int step, Dim dimension, long value) {
- Map scalars= new HashMap();
- scalars.put(dimension, new Scalar(dimension, value));
- return new DataPoint(step, scalars);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeterFactory.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeterFactory.java
deleted file mode 100755
index b54a16e0f..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/SystemTimePerformanceMeterFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance;
-
-import org.eclipse.test.performance.PerformanceMeter;
-
-public class SystemTimePerformanceMeterFactory extends PerformanceMeterFactory {
-
- protected PerformanceMeter doCreatePerformanceMeter(String scenario) {
- return new SystemTimePerformanceMeter(scenario);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Assert.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Assert.java
deleted file mode 100755
index 6496536df..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Assert.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks
- * in code. The static predicate methods all test a condition and throw some
- * type of unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are
- * thrown when something is misbehaving. Assertion failures are invariably
- * unspecified behavior; consequently, clients should never rely on
- * these being thrown (or not thrown). <b>If you find yourself in the
- * position where you need to catch an assertion failure, you have most
- * certainly written your program incorrectly.</b>
- * </p>
- * <p>
- * Note that an <code>assert</code> statement is slated to be added to the
- * Java language in JDK 1.4, rending this class obsolete.
- * </p>
- */
-public final class Assert {
-
- /**
- * <code>AssertionFailedException</code> is a runtime exception thrown
- * by some of the methods in <code>Assert</code>.
- * <p>
- * This class is not declared public to prevent some misuses; programs that catch
- * or otherwise depend on assertion failures are susceptible to unexpected
- * breakage when assertions in the code are added or removed.
- * </p>
- */
- private static class AssertionFailedException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructs a new exception with the given message.
- *
- * @param detail the detailed message
- */
- public AssertionFailedException(String detail) {
- super(detail);
- }
- }
-
- /* This class is not intended to be instantiated. */
- private Assert() {
- // empty
- }
-
- /**
- * Asserts that an argument is legal. If the given boolean is
- * not <code>true</code>, an <code>IllegalArgumentException</code>
- * is thrown.
- *
- * @param expression the outcome of the check
- * @return <code>true</code> if the check passes (does not return
- * if the check fails)
- * @exception IllegalArgumentException if the legality test failed
- */
- public static boolean isLegal(boolean expression) {
- // succeed as quickly as possible
- if (expression) {
- return true;
- }
- return isLegal(expression, "");//$NON-NLS-1$
- }
-
- /**
- * Asserts that an argument is legal. If the given boolean is
- * not <code>true</code>, an <code>IllegalArgumentException</code>
- * is thrown.
- * The given message is included in that exception, to aid debugging.
- *
- * @param expression the outcome of the check
- * @param message the message to include in the exception
- * @return <code>true</code> if the check passes (does not return
- * if the check fails)
- * @exception IllegalArgumentException if the legality test failed
- */
- public static boolean isLegal(boolean expression, String message) {
- if (!expression)
- throw new IllegalArgumentException("assertion failed; " + message); //$NON-NLS-1$
- return expression;
- }
-
- /**
- * Asserts that the given object is not <code>null</code>. If this
- * is not the case, some kind of unchecked exception is thrown.
- * <p>
- * As a general rule, parameters passed to API methods must not be
- * <code>null</code> unless <b>explicitly</b> allowed in the method's
- * specification. Similarly, results returned from API methods are never
- * <code>null</code> unless <b>explicitly</b> allowed in the method's
- * specification. Implementations are encouraged to make regular use of
- * <code>Assert.isNotNull</code> to ensure that <code>null</code>
- * parameters are detected as early as possible.
- * </p>
- *
- * @param object the value to test
- */
- public static void isNotNull(Object object) {
- // succeed as quickly as possible
- if (object != null) {
- return;
- }
- isNotNull(object, "");//$NON-NLS-1$
- }
-
- /**
- * Asserts that the given object is not <code>null</code>. If this
- * is not the case, some kind of unchecked exception is thrown.
- * The given message is included in that exception, to aid debugging.
- * <p>
- * As a general rule, parameters passed to API methods must not be
- * <code>null</code> unless <b>explicitly</b> allowed in the method's
- * specification. Similarly, results returned from API methods are never
- * <code>null</code> unless <b>explicitly</b> allowed in the method's
- * specification. Implementations are encouraged to make regular use of
- * <code>Assert.isNotNull</code> to ensure that <code>null</code>
- * parameters are detected as early as possible.
- * </p>
- *
- * @param object the value to test
- * @param message the message to include in the exception
- */
- public static void isNotNull(Object object, String message) {
- if (object == null)
- throw new AssertionFailedException("null argument;" + message);//$NON-NLS-1$
- }
-
- /**
- * Asserts that the given boolean is <code>true</code>. If this
- * is not the case, some kind of unchecked exception is thrown.
- *
- * @param expression the outcome of the check
- * @return <code>true</code> if the check passes (does not return
- * if the check fails)
- */
- public static boolean isTrue(boolean expression) {
- // succeed as quickly as possible
- if (expression) {
- return true;
- }
- return isTrue(expression, "");//$NON-NLS-1$
- }
-
- /**
- * Asserts that the given boolean is <code>true</code>. If this
- * is not the case, some kind of unchecked exception is thrown.
- * The given message is included in that exception, to aid debugging.
- *
- * @param expression the outcome of the check
- * @param message the message to include in the exception
- * @return <code>true</code> if the check passes (does not return
- * if the check fails)
- */
- public static boolean isTrue(boolean expression, String message) {
- if (!expression)
- throw new AssertionFailedException("Assertion failed: "+message);//$NON-NLS-1$
- return expression;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Entries
deleted file mode 100644
index 2daee7ace..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Entries
+++ /dev/null
@@ -1,9 +0,0 @@
-/Assert.java/1.5/Tue Mar 31 07:06:59 2009//Tv20101027
-/DataPoint.java/1.10/Mon Feb 20 15:39:47 2006//Tv20101027
-/Dim.java/1.10/Tue Sep 1 11:04:42 2009//Tv20101027
-/DimensionMessages.java/1.6/Fri Oct 19 14:19:07 2007//Tv20101027
-/DimensionMessages.properties/1.7/Fri Oct 19 14:19:07 2007//Tv20101027
-/Sample.java/1.15/Fri Feb 1 17:17:44 2008//Tv20101027
-/Scalar.java/1.6/Mon Feb 20 15:39:47 2006//Tv20101027
-/Unit.java/1.13/Mon Feb 20 15:39:47 2006//Tv20101027
-D
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Repository
deleted file mode 100644
index a2a656154..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DataPoint.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DataPoint.java
deleted file mode 100755
index 1c2ec719a..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DataPoint.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * @since 3.1
- */
-public class DataPoint {
- private int fStep;
- private Map fScalars;
-
- public DataPoint(int step, Map values) {
- fStep= step;
- fScalars= values;
- }
-
- public int getStep() {
- return fStep;
- }
-
- public Dim[] getDimensions() {
- Set set= fScalars.keySet();
- return (Dim[]) set.toArray(new Dim[set.size()]);
- }
-
- public Collection getDimensions2() {
- return fScalars.keySet();
- }
-
- public boolean contains(Dim dimension) {
- return fScalars.containsKey(dimension);
- }
-
- public Scalar[] getScalars() {
- return (Scalar[]) fScalars.values().toArray(new Scalar[fScalars.size()]);
- }
-
- public Scalar getScalar(Dim dimension) {
- return (Scalar) fScalars.get(dimension);
- }
-
- public String toString() {
- return "DataPoint [step= " + fStep + ", #dimensions: " + fScalars.size() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Dim.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Dim.java
deleted file mode 100755
index 2109284a8..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Dim.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-import org.eclipse.test.internal.performance.InternalDimensions;
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.performance.Dimension;
-
-/**
- * @since 3.1
- */
-public class Dim implements Dimension {
-
- private static Dim[] fgRegisteredDimensions= new Dim[100];
-
- private final int fId;
- private final Unit fUnit;
- private final int fMultiplier;
- private String shortName;
-
- public static Dim getDimension(int id) {
- InternalDimensions.COMITTED.getId(); // trigger loading class InternalDimensions
- if (id >= 0 && id < fgRegisteredDimensions.length)
- return fgRegisteredDimensions[id];
- return null;
- }
-
- public Dim(int id) {
- this(id, Unit.CARDINAL, 1);
- }
-
- public Dim(int id, Unit unit) {
- this(id, unit, 1);
- }
-
- public Dim(int id, Unit unit, int multiplier) {
-
- if (id >= 0 && id < fgRegisteredDimensions.length) {
- if (fgRegisteredDimensions[id] == null) {
- fgRegisteredDimensions[id]= this;
- } else
- PerformanceTestPlugin.logError("dimension with id '" + id + "' already registered"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- this.fId= id;
- this.fUnit= unit;
- this.fMultiplier= multiplier;
- }
-
- public int getId() {
- return this.fId;
- }
-
- public Unit getUnit() {
- return this.fUnit;
- }
-
- public int getMultiplier() {
- return this.fMultiplier;
- }
-
- public String getName() {
- return DimensionMessages.getString(this.fId);
- }
-
- /**
- * Returns the label for the current dimension.
- * This label is done keeping only uppercase characters from the name.
- * It's typically used for anchor references based on dimension.
- *
- * @return The short name of the dimension
- */
- public String getLabel() {
- if (this.shortName == null) {
- String name = getName();
- StringBuffer buffer = new StringBuffer();
- int length = name.length();
- for (int i=0; i<length; i++) {
- if (Character.isUpperCase(name.charAt(i))) {
- buffer.append(name.charAt(i));
- }
- }
- this.shortName = buffer.toString();
- }
- return this.shortName;
- }
-
- public String getDescription() {
- return DimensionMessages.getString(this.fId);
- }
-
- public String toString() {
- return "Dimension [name=" + getName() + ", " + this.fUnit + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public String getDisplayValue(Scalar scalar) {
- return this.fUnit.getDisplayValue1(scalar.getMagnitude(), this.fMultiplier);
- }
-
- public String getDisplayValue(double scalar) {
- return this.fUnit.getDisplayValue1(scalar / this.fMultiplier);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.java
deleted file mode 100755
index b4251185e..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-
-/**
- * @since 3.1
- */
-public class DimensionMessages {
-
- private static final String BUNDLE_NAME= "org.eclipse.test.internal.performance.data.DimensionMessages";//$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
-
- private DimensionMessages() {
- // emtpy
- }
-
- public static String getString(int id) {
- return getString("dimension." + id); //$NON-NLS-1$
- }
-
- public static String getDescription(int id) {
- return getString("dimension.description." + id); //$NON-NLS-1$
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.properties b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.properties
deleted file mode 100755
index 4ae3d1944..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/DimensionMessages.properties
+++ /dev/null
@@ -1,94 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 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
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-# Dimension Name
-dimension.2=System Time
-dimension.3=Used Java Heap
-dimension.4=Working Set
-dimension.7=Committed
-dimension.8=Working Set Peak
-dimension.9=Elapsed Process
-dimension.10=User time
-dimension.11=Kernel time
-dimension.19=Page Faults
-dimension.20=CPU Time
-dimension.22=Commit Limit
-dimension.23=Commit Peak
-dimension.24=Physical Memory
-dimension.25=Physical Available
-dimension.26=System Cache
-dimension.27=Kernel Total
-dimension.28=Kernel Paged
-dimension.29=Kernel Nonpaged
-dimension.30=Page Size
-dimension.31=Handle Count
-dimension.32=Process Count
-dimension.33=Thread Count
-dimension.34=GDI Objects
-dimension.35=USER Objects
-dimension.36=Open Handles
-dimension.37=Commit Total
-dimension.38=Read Count
-dimension.39=Write Count
-dimension.40=Bytes Read
-dimension.41=Bytes Written
-dimension.42=Hard Page Faults
-dimension.43=Soft Page Faults
-dimension.44=Text Size
-dimension.45=Data Size
-dimension.46=Library Size
-dimension.48=Used Memory
-dimension.49=Free Memory
-dimension.50=Buffers Memory
-dimension.51=Free Java Memory
-dimension.52=Invocation Count
-
-# Dimension Description
-dimension.description.2=* no longer measured, same as elapsed time, see PerformanceMonitor *
-dimension.description.3=Change in the amount of memory allocated for Java objects.
-dimension.description.4=Change in the amount of physical memory used by the process (other data resides in swap space).
-dimension.description.7=Change in the amount of allocated memory (both, in physical memory and swap space, can be preallocated for future use).
-dimension.description.8=Increase of the maximum working set size, useful with start-up tests.
-dimension.description.9=Amount of wall-clock time.
-dimension.description.10=User time
-dimension.description.11=Amount of time the process ran on the CPU, while the CPU was in kernel mode.
-dimension.description.19=Number of memory pages that were loaded from swap space on disk or from memory (i.e., in the latter case, they were not mapped in the process' page table, but already present in memory for some reason).
-dimension.description.20=Amount of time the process ran on the CPU.
-dimension.description.22=Commit Limit
-dimension.description.23=Commit Peak
-dimension.description.24=Physical Memory
-dimension.description.25=Physical Available
-dimension.description.26=System Cache
-dimension.description.27=Kernel Total
-dimension.description.28=Kernel Paged
-dimension.description.29=Kernel Nonpaged
-dimension.description.30=Page Size
-dimension.description.31=Handle Count
-dimension.description.32=Process Count
-dimension.description.33=Thread Count
-dimension.description.34=Change in the number of GDI (Graphics Device Interface) objects, can be useful for UI tests (particularly start-up tests).
-dimension.description.35=USER Objects
-dimension.description.36=Open Handles
-dimension.description.37=Commit Total
-dimension.description.38=Read Count
-dimension.description.39=Write Count
-dimension.description.40=Bytes Read
-dimension.description.41=Bytes Written
-dimension.description.42=Number of memory pages that were loaded from swap space on disk.
-dimension.description.43=Number of memory pages that were loaded from memory (i.e., they were not mapped in the process' page table, but already present in memory for some reason).
-dimension.description.44=Change in the process' code memory size, useful with start-up tests.
-dimension.description.45=Change in the process' data and stack memory size.
-dimension.description.46=Change in the process' library memory size.
-dimension.description.48=Used Memory
-dimension.description.49=Free Memory
-dimension.description.50=Buffers Memory
-dimension.description.51=Free Java Memory
-dimension.description.52=Invocation Count
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Sample.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Sample.java
deleted file mode 100755
index ae23826f0..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Sample.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.test.performance.Dimension;
-
-import junit.framework.Assert;
-
-/**
- * @since 3.1
- */
-public class Sample {
- String fScenarioID;
- long fStartTime;
- Map fProperties;
- DataPoint[] fDataPoints;
-
- boolean fIsSummary;
- boolean fSummaryIsGlobal;
- String fShortName;
- Dimension[] fSummaryDimensions;
- int fCommentType;
- String fComment;
-
-
- public Sample(String scenarioID, long starttime, Map properties, DataPoint[] dataPoints) {
- Assert.assertTrue("scenarioID is null", scenarioID != null); //$NON-NLS-1$
- fScenarioID= scenarioID;
- fStartTime= starttime;
- fProperties= properties;
- fDataPoints= dataPoints;
- }
-
- public Sample(DataPoint[] dataPoints) {
- fDataPoints= dataPoints;
- }
-
- public void setComment(int commentType, String comment) {
- fCommentType= commentType;
- fComment= comment;
- }
-
- public void tagAsSummary(boolean global, String shortName, Dimension[] summaryDimensions, int commentType, String comment) {
- fIsSummary= true;
- fSummaryIsGlobal= global;
- fShortName= shortName;
- fSummaryDimensions= summaryDimensions;
- fCommentType= commentType;
- fComment= comment;
- }
-
- public String getScenarioID() {
- return fScenarioID;
- }
-
- public long getStartTime() {
- return fStartTime;
- }
-
- public String getProperty(String name) {
- return (String) fProperties.get(name);
- }
-
- public String[] getPropertyKeys() {
- if (fProperties == null)
- return new String[0];
- Set set= fProperties.keySet();
- return (String[]) set.toArray(new String[set.size()]);
- }
-
- public DataPoint[] getDataPoints() {
- DataPoint[] dataPoints= new DataPoint[fDataPoints.length];
- System.arraycopy(fDataPoints, 0, dataPoints, 0, fDataPoints.length);
- return dataPoints;
- }
-
- public String toString() {
- return "MeteringSession [scenarioID= " + fScenarioID + ", #datapoints: " + fDataPoints.length + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public boolean isSummary() {
- return fIsSummary;
- }
-
- public boolean isGlobal() {
- return fSummaryIsGlobal;
- }
-
- public String getShortname() {
- return fShortName;
- }
-
- public Dimension[] getSummaryDimensions() {
- return fSummaryDimensions;
- }
-
- public int getCommentType() {
- return fCommentType;
- }
-
- public String getComment() {
- return fComment;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Scalar.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Scalar.java
deleted file mode 100755
index 6fd3c028a..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Scalar.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-
-/**
- * @since 3.1
- */
-public class Scalar {
- private Dim fDimension;
- private long fMagnitude;
-
- public Scalar(Dim dimension, long extent) {
- fDimension= dimension;
- fMagnitude= extent;
- }
-
- public Dim getDimension() {
- return fDimension;
- }
-
- public long getMagnitude() {
- return fMagnitude;
- }
-
- public String toString() {
- if (fDimension == null)
- return "Scalar [dimension= " + fDimension + ", magnitude= " + fMagnitude + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return "Scalar [" + fDimension.getName() + ": " + fDimension.getDisplayValue(this) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Unit.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Unit.java
deleted file mode 100755
index 603009820..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/data/Unit.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.data;
-
-import java.text.NumberFormat;
-
-
-/**
- * @since 3.1
- */
-public class Unit {
-
- public static final Unit SECOND= new Unit("s", "second", false); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Unit BYTE= new Unit("byte", "byte", true); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Unit CARDINAL= new Unit("", "", false); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Unit INVOCATION= new Unit("invoc.", "invocation", false); //$NON-NLS-1$ //$NON-NLS-2$
-
- private static final int T_DECIMAL= 1000;
- private static final int T_BINARY= 1024;
-
- //protected static final String[] PREFIXES= new String[] { "y", "z", "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" };
- //protected static final String[] FULL_PREFIXES= new String[] { "yocto", "zepto", "atto", "femto", "pico", "nano", "micro", "milli", "", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta" };
- //protected static final String[] BINARY_PREFIXES= new String[] { "", "", "", "", "", "", "", "", "", "ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi" };
- //protected static final String[] BINARY_FULL_PREFIXES= new String[] { "", "", "", "", "", "", "", "", "", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi" };
-
- private final String fShortName;
- private final String fFullName;
- private final boolean fIsBinary;
- //private final int fPrecision= 2;
-
- public Unit(String shortName, String fullName, boolean binary) {
- fShortName= shortName;
- fFullName= fullName;
- fIsBinary= binary;
- }
-
- public String getShortName() {
- return fShortName;
- }
-
- public String getFullName() {
- return fFullName;
- }
-
- public String getDisplayValue1(long magnitudel, int multiplier) {
-
- //return getDisplayValue1(magnitudel / multiplier);
- //return Long.toString((double)(magnitudel / multiplier));
- return getDisplayValue1(magnitudel / multiplier);
- }
-
- public String getDisplayValue1(double magnitude) {
-
- if (this == SECOND)
- return formatedTime((long) (magnitude*1000.0));
- return formatEng((long) (magnitude));
-
- /*
- int div= fIsBinary ? T_BINARY : T_DECIMAL;
- boolean negative= magnitude < 0;
- double mag= Math.abs(magnitude), ratio= mag / div;
- int divs= PREFIXES.length / 2;
- while (ratio >= 1) {
- mag= ratio;
- divs++;
- ratio= mag / div;
- }
- ratio= mag * div;
- while (ratio > 0.0 && ratio < div) {
- mag= ratio;
- divs--;
- ratio= mag * div;
- }
-
- if (negative)
- mag= -mag;
-
- String[] prefixes= fIsBinary ? BINARY_PREFIXES : PREFIXES;
- NumberFormat format= NumberFormat.getInstance();
- format.setMaximumFractionDigits(fPrecision);
- if (divs > 0 && divs <= prefixes.length)
- return prefixes[divs] + getShortName() + format.format(mag);
- else
- return getShortName() + magnitude;
- */
- }
-
- public String toString() {
- return "Unit [" + getShortName() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Answer a formatted string for the elapsed time (minutes, hours or days)
- * that is appropriate for the scale of the time.
- *
- * @param diff time in milliseconds
- *
- * I copied this from karasiuk.utility.TimeIt
- * @return the formatted time
- */
- public static String formatedTime(long diff) {
- long sign= diff < 0 ? -1 : 1;
- diff = Math.abs(diff);
-
- if (diff < 1000)
- return String.valueOf(sign * diff) + "ms"; //$NON-NLS-1$
-
- NumberFormat nf= NumberFormat.getInstance();
- nf.setMaximumFractionDigits(2);
- double d = diff / 1000.0;
- if (d < 60)
- return nf.format(sign * d) + "s"; //$NON-NLS-1$
-
- d = d / 60.0;
- if (d < 60.0)
- return nf.format(sign * d) + "m"; //$NON-NLS-1$
-
- d = d / 60.0;
- if (d < 24.0)
- return nf.format(sign * d) + "h"; //$NON-NLS-1$
-
- d = d / 24.0;
- return nf.format(sign * d) + "d"; //$NON-NLS-1$
- }
-
- /**
- * Answer a number formatted using engineering conventions, K thousands, M millions,
- * G billions and T trillions.
- *
- * I copied this method from karasiuk.utility.Misc.
- * @param n the number to format
- * @return the formatted number
- */
- public String formatEng(long n) {
- long sign= n < 0 ? -1 : 1;
- n = Math.abs(n);
- int TSD= fIsBinary ? T_BINARY : T_DECIMAL;
- if (n < TSD)
- return String.valueOf(sign*n);
- double d = ((double)n) / TSD;
- NumberFormat nf = NumberFormat.getInstance();
- nf.setMaximumFractionDigits(2);
- if (d < TSD)
- return nf.format(sign * d) + "K"; //$NON-NLS-1$
-
- d = d / TSD;
- if ( d < TSD)
- return nf.format(sign * d) + "M"; //$NON-NLS-1$
-
- d = d / TSD;
- if ( d < TSD)
- return nf.format(sign * d) + "G"; //$NON-NLS-1$
-
- d = d / TSD;
- return nf.format(sign * d) + "T"; //$NON-NLS-1$
- }
-
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Entries
deleted file mode 100644
index 43755257c..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Entries
+++ /dev/null
@@ -1,10 +0,0 @@
-/DB.java/1.76/Wed Oct 27 12:43:24 2010//Tv20101027
-/DBHelpers.java/1.15/Fri Jan 22 19:12:02 2010//Tv20101027
-/Report.java/1.5/Mon Feb 20 15:39:45 2006//Tv20101027
-/SQL.java/1.35/Mon Oct 15 10:56:42 2007//Tv20101027
-/Scenario.java/1.25/Mon Feb 20 15:39:45 2006//Tv20101027
-/SummaryEntry.java/1.6/Mon Feb 20 15:39:45 2006//Tv20101027
-/TimeSeries.java/1.7/Mon Feb 20 15:39:45 2006//Tv20101027
-/Variations.java/1.8/Mon Feb 20 15:39:45 2006//Tv20101027
-/View.java/1.18/Fri Jan 22 19:12:01 2010//Tv20101027
-D
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Repository
deleted file mode 100644
index 8f978f694..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DB.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DB.java
deleted file mode 100755
index 432916552..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DB.java
+++ /dev/null
@@ -1,816 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import java.io.File;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import junit.framework.Assert;
-
-import org.eclipse.test.internal.performance.InternalPerformanceMeter;
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Sample;
-import org.eclipse.test.internal.performance.data.Scalar;
-import org.eclipse.test.internal.performance.eval.StatisticsSession;
-import org.eclipse.test.performance.Dimension;
-import org.eclipse.test.performance.Performance;
-
-public class DB {
-
- private static final boolean DEBUG= false;
- private static final boolean AGGREGATE= true;
-
- // the two supported DB types
- private static final String DERBY= "derby"; //$NON-NLS-1$
- private static final String CLOUDSCAPE= "cloudscape"; //$NON-NLS-1$
-
- private static DB fgDefault;
-
- private Connection fConnection;
- private SQL fSQL;
- private int fStoredSamples;
- private boolean fStoreCalled;
- private boolean fIsEmbedded;
- private String fDBType; // either "derby" or "cloudscape"
-
-
- // Datapaoints
- public static DataPoint[] queryDataPoints(Variations variations, String scenarioName, Set dims) {
- return getDefault().internalQueryDataPoints(variations, scenarioName, dims);
- }
-
- // Scenarios
- /**
- * Return all Scenarios that match the given config, build, and scenario name.
- * @param configName
- * @param buildPattern
- * @param scenarioPattern
- * @return array of scenarios
- * @deprecated Use queryScenarios(Variations variations, ...) instead
- */
- public static Scenario[] queryScenarios(String configName, String buildPattern, String scenarioPattern) {
- Variations variations= new Variations();
- variations.put(PerformanceTestPlugin.CONFIG, configName);
- variations.put(PerformanceTestPlugin.BUILD, buildPattern);
- return queryScenarios(variations, scenarioPattern, PerformanceTestPlugin.BUILD, null);
- }
-
- /**
- * @param configName
- * @param buildPatterns
- * @param scenarioPattern
- * @param dimensions
- * @return array of scenarios
- * @deprecated Use queryScenarios(Variations variations, ...) instead
- */
- public static Scenario[] queryScenarios(String configName, String[] buildPatterns, String scenarioPattern, Dim[] dimensions) {
- Variations variations= new Variations();
- variations.put(PerformanceTestPlugin.CONFIG, configName);
- variations.put(PerformanceTestPlugin.BUILD, buildPatterns);
- return queryScenarios(variations, scenarioPattern, PerformanceTestPlugin.BUILD, dimensions);
- }
-
- /**
- * @param configName
- * @param buildPatterns
- * @param scenarioName
- * @return Scenario
- * @deprecated Use queryScenarios(Variations variations, ...) instead
- */
- public static Scenario queryScenario(String configName, String[] buildPatterns, String scenarioName) {
- Variations variations= new Variations();
- variations.put(PerformanceTestPlugin.CONFIG, configName);
- variations.put(PerformanceTestPlugin.BUILD, buildPatterns);
- return new Scenario(scenarioName, variations, PerformanceTestPlugin.BUILD, null);
- }
-
- /**
- * Returns all Scenarios that match the given variation and scenario pattern.
- * Every Scenario returned contains a series of datapoints specified by the seriesKey.
- *
- * For example to get the datapoints for
- * For every Scenario only the specified Diemnsions are retrieved from the database.
- * @param variations
- * @param scenarioPattern
- * @param seriesKey
- * @param dimensions
- * @return array of scenarios or <code>null</code> if an error occured.
- */
- public static Scenario[] queryScenarios(Variations variations, String scenarioPattern, String seriesKey, Dim[] dimensions) {
- String[] scenarioNames= getDefault().internalQueryScenarioNames(variations, scenarioPattern); // get all Scenario names
- if (scenarioNames == null)
- return new Scenario[0];
- Scenario.SharedState ss= new Scenario.SharedState(variations, scenarioPattern, seriesKey, dimensions);
- Scenario[] tables= new Scenario[scenarioNames.length];
- for (int i= 0; i < scenarioNames.length; i++)
- tables[i]= new Scenario(scenarioNames[i], ss);
- return tables;
- }
-
- /**
- * Returns all summaries that match the given variation and scenario patterns.
- * If scenarioPattern is null, all summary scenarios are returned that are marked as "global".
- * If scenarioPattern is not null, it is used to filter the scenarios and only scenarios marked as "local" are returned.
- * @param variationPatterns
- * @param scenarioPattern
- * @return array of summaries or <code>null</code> if an error occured.
- */
- public static SummaryEntry[] querySummaries(Variations variationPatterns, String scenarioPattern) {
- return getDefault().internalQuerySummaries(variationPatterns, scenarioPattern);
- }
-
- /**
- * @param names
- * @param variationPatterns
- * @param scenarioPattern
- * @deprecated Use queryDistinctValues instead
- */
- public static void queryBuildNames(List names, Variations variationPatterns, String scenarioPattern) {
- getDefault().internalQueryDistinctValues(names, PerformanceTestPlugin.BUILD, variationPatterns, scenarioPattern);
- }
-
- public static void queryDistinctValues(List values, String key, Variations variationPatterns, String scenarioPattern) {
- getDefault().internalQueryDistinctValues(values, key, variationPatterns, scenarioPattern);
- }
-
- public static String[] querySeriesValues(String scenarioName, Variations v, String seriesKey) {
- return getDefault().internalQuerySeriesValues(v, scenarioName, seriesKey);
- }
-
- public static Scenario getScenarioSeries(String scenarioName, Variations v, String seriesKey, String startBuild, String endBuild, Dim[] dims) {
- v= (Variations) v.clone();
- v.put(seriesKey, new String[] { startBuild, endBuild });
- Scenario.SharedState ss= new Scenario.SharedState(v, scenarioName, seriesKey, dims);
- Scenario scenario= new Scenario(scenarioName, ss);
- TimeSeries ts= scenario.getTimeSeries(dims[0]);
- if (ts.getLength() < 2) {
- v.put(seriesKey, "%"); //$NON-NLS-1$
- String[] names= DB.querySeriesValues(scenarioName, v, seriesKey);
- if (names.length >= 2) {
- String start= findClosest(names, startBuild);
- String end= findClosest(names, endBuild);
- v.put(seriesKey, new String[] { start, end });
- scenario= new Scenario(scenarioName, ss);
- }
- }
- return scenario;
- }
-
- public static Map queryFailure(String scenarioPattern, Variations variations) {
- return getDefault().internalQueryFailure(scenarioPattern, variations);
- }
-
- private static String findClosest(String[] names, String name) {
- for (int i= 0; i < names.length; i++)
- if (names[i].equals(name))
- return name;
-
- Pattern pattern= Pattern.compile("200[3-9][01][0-9][0-3][0-9]"); //$NON-NLS-1$
- Matcher matcher= pattern.matcher(name);
-
- if (!matcher.find())
- return name;
-
- int x= Integer.parseInt(name.substring(matcher.start(), matcher.end()));
- int ix= -1;
- int mind= 0;
-
- for (int i= 0; i < names.length; i++) {
- matcher.reset(names[i]);
- if (matcher.find()) {
- int y= Integer.parseInt(names[i].substring(matcher.start(), matcher.end()));
- int d= Math.abs(y-x);
- if (ix < 0 || d < mind) {
- mind= d;
- ix= i;
- }
- }
- }
-
- if (ix >= 0)
- return names[ix];
- return name;
- }
-
- /**
- * Store the data contained in the given sample in the database.
- * The data is tagged with key/value pairs from variations.
- * @param variations used to tag the data in the database
- * @param sample the sample to store
- * @return returns true if data could be stored successfully
- */
- public static boolean store(Variations variations, Sample sample) {
- return getDefault().internalStore(variations, sample);
- }
-
- /**
- * @param variations used to tag the data in the database
- * @param sample the sample maked as failed
- * @param failMesg the reason of the failure
- */
- public static void markAsFailed(Variations variations, Sample sample, String failMesg) {
- getDefault().internalMarkAsFailed(variations, sample, failMesg);
- }
-
- public static Connection getConnection() {
- return getDefault().fConnection;
- }
-
- public static boolean isActive() {
- return fgDefault != null && fgDefault.getSQL() != null;
- }
-
- //---- private implementation
-
- /**
- * Private constructor to block instance creation.
- */
- private DB() {
- // empty implementation
- }
-
- synchronized static DB getDefault() {
- if (fgDefault == null) {
- fgDefault= new DB();
- fgDefault.connect();
- if (PerformanceTestPlugin.getDefault() == null) {
- // not started as plugin
- Runtime.getRuntime().addShutdownHook(
- new Thread() {
- public void run() {
- shutdown();
- }
- }
- );
- }
- }
- return fgDefault;
- }
-
- public static void shutdown() {
- if (DEBUG) System.out.println("DB.shutdown"); //$NON-NLS-1$
- if (fgDefault != null) {
- fgDefault.disconnect();
- fgDefault= null;
- }
- }
-
- SQL getSQL() {
- return fSQL;
- }
-
- private void internalMarkAsFailed(Variations variations, Sample sample, String failMesg) {
-
- if (fSQL == null)
- return;
-
- try {
- int variation_id= fSQL.getVariations(variations);
- int scenario_id= fSQL.getScenario(sample.getScenarioID());
-
- fSQL.insertFailure(variation_id, scenario_id, failMesg);
-
- fConnection.commit();
-
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
- try {
- fConnection.rollback();
- } catch (SQLException e1) {
- PerformanceTestPlugin.log(e1);
- }
- }
- }
-
- private boolean internalStore(Variations variations, Sample sample) {
-
- if (fSQL == null || sample == null)
- return false;
-
- DataPoint[] dataPoints= sample.getDataPoints();
- int n= dataPoints.length;
- if (n <= 0)
- return false;
-
- //System.out.println("store started..."); //$NON-NLS-1$
- try {
- //long l= System.currentTimeMillis();
- int variation_id= fSQL.getVariations(variations);
- int scenario_id= fSQL.getScenario(sample.getScenarioID());
- String comment= sample.getComment();
- if (sample.isSummary()) {
- boolean isGlobal= sample.isGlobal();
-
- int commentId= 0;
- int commentKind= sample.getCommentType();
- if (commentKind == Performance.EXPLAINS_DEGRADATION_COMMENT && comment != null)
- commentId= fSQL.getCommentId(commentKind, comment);
-
- Dimension[] summaryDimensions= sample.getSummaryDimensions();
- for (int i= 0; i < summaryDimensions.length; i++) {
- Dimension dimension= summaryDimensions[i];
- if (dimension instanceof Dim)
- fSQL.createSummaryEntry(variation_id, scenario_id, ((Dim)dimension).getId(), isGlobal, commentId);
- }
- String shortName= sample.getShortname();
- if (shortName != null)
- fSQL.setScenarioShortName(scenario_id, shortName);
- } else if (comment != null) {
- int commentId= 0;
- int commentKind= sample.getCommentType();
- if (commentKind == Performance.EXPLAINS_DEGRADATION_COMMENT) {
- commentId= fSQL.getCommentId(commentKind, comment);
- }
- fSQL.createSummaryEntry(variation_id, scenario_id, 0, false, commentId); // use special dim id '0' to identify summary entry created to only handle a comment
- }
- int sample_id= fSQL.createSample(variation_id, scenario_id, new Timestamp(sample.getStartTime()));
-
- if (AGGREGATE) {
- StatisticsSession stats= new StatisticsSession(dataPoints);
- Dim[] dims= dataPoints[0].getDimensions();
-
- int datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.AVERAGE);
- for (int i= 0; i < dims.length; i++) {
- Dim dim= dims[i];
- fSQL.insertScalar(datapoint_id, dim.getId(), (long) stats.getAverage(dim));
- }
-
- datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.STDEV);
- for (int i= 0; i < dims.length; i++) {
- Dim dim= dims[i];
- // see StatisticsSession
- long value= Double.doubleToLongBits(stats.getStddev(dim));
- fSQL.insertScalar(datapoint_id, dim.getId(), value);
- }
-
- datapoint_id= fSQL.createDataPoint(sample_id, 0, InternalPerformanceMeter.SIZE);
- for (int i= 0; i < dims.length; i++) {
- Dim dim= dims[i];
- fSQL.insertScalar(datapoint_id, dim.getId(), stats.getCount(dim));
- }
- } else {
- for (int i= 0; i < dataPoints.length; i++) {
- DataPoint dp= dataPoints[i];
- int datapoint_id= fSQL.createDataPoint(sample_id, i, dp.getStep());
- Scalar[] scalars= dp.getScalars();
- for (int j= 0; j < scalars.length; j++) {
- Scalar scalar= scalars[j];
- int dim_id= scalar.getDimension().getId();
- long value= scalar.getMagnitude();
- fSQL.insertScalar(datapoint_id, dim_id, value);
- }
- }
- }
-
- fConnection.commit();
- fStoredSamples++;
- fStoreCalled= true;
-
- //System.err.println(System.currentTimeMillis()-l);
-
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
- try {
- fConnection.rollback();
- } catch (SQLException e1) {
- PerformanceTestPlugin.log(e1);
- }
- }
- return true;
- }
-
- private DataPoint[] internalQueryDataPoints(Variations variations, String scenarioName, Set dimSet) {
- if (fSQL == null)
- return null;
-
- long start = System.currentTimeMillis();
- if (DEBUG)
- System.out.print(" - query data points from DB for scenario "+scenarioName+"..."); //$NON-NLS-1$ //$NON-NLS-2$
- ResultSet rs= null;
- try {
- ArrayList dataPoints= new ArrayList();
- rs= fSQL.queryDataPoints(variations, scenarioName);
- if (DEBUG) {
- long time = System.currentTimeMillis();
- System.out.println("done in "+(time-start)+"ms"); //$NON-NLS-1$ //$NON-NLS-2$
- start = time;
- }
- while (rs.next()) {
- int datapoint_id= rs.getInt(1);
- int step= rs.getInt(2);
-
- HashMap map= new HashMap();
- ResultSet rs2= fSQL.queryScalars(datapoint_id);
- while (rs2.next()) {
- int dim_id= rs2.getInt(1);
- long value= rs2.getBigDecimal(2).longValue();
- Dim dim= Dim.getDimension(dim_id);
- if (dim != null) {
- if (dimSet == null || dimSet.contains(dim))
- map.put(dim, new Scalar(dim, value));
- }
- }
- if (map.size() > 0)
- dataPoints.add(new DataPoint(step, map));
-
- rs2.close();
- }
- rs.close();
-
- int n= dataPoints.size();
- if (DEBUG) {
- long time = System.currentTimeMillis();
- System.out.println(" + " + n + " datapoints created in "+(time-start)+"ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return (DataPoint[])dataPoints.toArray(new DataPoint[n]);
-
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
-
- } finally {
- if (rs != null)
- try {
- rs.close();
- } catch (SQLException e1) {
- // ignored
- }
- }
- return null;
- }
-
- /*
- * Returns array of scenario names matching the given pattern.
- */
- private String[] internalQueryScenarioNames(Variations variations, String scenarioPattern) {
- if (fSQL == null)
- return null;
- long start = System.currentTimeMillis();
- if (DEBUG) System.out.print(" - query scenario names from DB for scenario pattern '"+scenarioPattern+"'..."); //$NON-NLS-1$ //$NON-NLS-2$
- ResultSet result= null;
- try {
- result= fSQL.queryScenarios(variations, scenarioPattern);
- ArrayList scenarios= new ArrayList();
- while (result.next())
- scenarios.add(result.getString(1));
- return (String[])scenarios.toArray(new String[scenarios.size()]);
-
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
-
- } finally {
- if (result != null) {
- try {
- result.close();
- } catch (SQLException e1) {
- // ignored
- }
- }
- if (DEBUG) {
- long time = System.currentTimeMillis();
- System.out.println("done in "+(time-start)+"ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return null;
- }
-
- /*
- *
- */
- private void internalQueryDistinctValues(List values, String seriesKey, Variations variations, String scenarioPattern) {
- if (fSQL == null)
- return;
- long start = System.currentTimeMillis();
- if (DEBUG) System.out.print(" - query distinct values from DB for scenario pattern '"+scenarioPattern+"'..."); //$NON-NLS-1$ //$NON-NLS-2$
- ResultSet result= null;
- try {
- result= fSQL.queryVariations(variations.toExactMatchString(), scenarioPattern);
- while (result.next()) {
- Variations v= new Variations();
- v.parseDB(result.getString(1));
- String build= v.getProperty(seriesKey);
- if (build != null && !values.contains(build))
- values.add(build);
- }
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
-
- } finally {
- if (result != null) {
- try {
- result.close();
- } catch (SQLException e1) {
- // ignored
- }
- }
- if (DEBUG) {
- long time = System.currentTimeMillis();
- System.out.println("done in "+(time-start)+"ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- private SummaryEntry[] internalQuerySummaries(Variations variationPatterns, String scenarioPattern) {
- if (fSQL == null)
- return null;
- long start = System.currentTimeMillis();
- if (DEBUG) System.out.print(" - query summaries from DB for scenario pattern '"+scenarioPattern+"'..."); //$NON-NLS-1$ //$NON-NLS-2$
- ResultSet result = null;
- try {
- List fingerprints= new ArrayList();
- if (scenarioPattern != null)
- result= fSQL.querySummaryEntries(variationPatterns, scenarioPattern);
- else
- result= fSQL.queryGlobalSummaryEntries(variationPatterns);
- while (result.next()) {
- String scenarioName= result.getString(1);
- String shortName= result.getString(2);
- int dim_id= result.getInt(3);
- boolean isGlobal= result.getShort(4) == 1;
- int comment_id= result.getInt(5);
- int commentKind= 0;
- String comment= null;
- if (comment_id != 0) {
- ResultSet rs2= fSQL.getComment(comment_id);
- if (rs2.next()) {
- commentKind= rs2.getInt(1);
- comment= rs2.getString(2);
- }
- }
- if (dim_id != 0) {
- fingerprints.add(new SummaryEntry(scenarioName, shortName, Dim.getDimension(dim_id), isGlobal, commentKind, comment));
- }
- }
- return (SummaryEntry[])fingerprints.toArray(new SummaryEntry[fingerprints.size()]);
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
- } finally {
- if (result != null) {
- try {
- result.close();
- } catch (SQLException e1) {
- // ignored
- }
- }
- if (DEBUG) {
- long time = System.currentTimeMillis();
- System.out.println("done in "+(time-start)+"ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return null;
- }
-
- private String[] internalQuerySeriesValues(Variations v, String scenarioName, String seriesKey) {
-
- boolean isCloned= false;
-
- String[] seriesPatterns= null;
- Object object= v.get(seriesKey);
- if (object instanceof String[])
- seriesPatterns= (String[]) object;
- else if (object instanceof String)
- seriesPatterns= new String[] { (String) object };
- else
- Assert.assertTrue(false);
-
- ArrayList values= new ArrayList();
- for (int i= 0; i < seriesPatterns.length; i++) {
- if (seriesPatterns[i].indexOf('%') >= 0) {
- if (! isCloned) {
- v= (Variations) v.clone();
- isCloned= true;
- }
- v.put(seriesKey, seriesPatterns[i]);
- internalQueryDistinctValues(values, seriesKey, v, scenarioName);
- } else
- values.add(seriesPatterns[i]);
- }
-
- String[] names= (String[])values.toArray(new String[values.size()]);
-
- boolean sort= true;
- Pattern pattern= Pattern.compile("200[3-9][01][0-9][0-3][0-9]"); //$NON-NLS-1$
- final Matcher matcher= pattern.matcher(""); //$NON-NLS-1$
- for (int i= 0; i < names.length; i++) {
- matcher.reset(names[i]);
- if (! matcher.find()) {
- sort= false;
- break;
- }
- }
- if (sort) {
- Arrays.sort(names,
- new Comparator() {
- public int compare(Object o1, Object o2) {
- String s1= (String)o1;
- String s2= (String)o2;
-
- matcher.reset(s1);
- if (matcher.find())
- s1= s1.substring(matcher.start());
-
- matcher.reset(s2);
- if (matcher.find())
- s2= s2.substring(matcher.start());
-
- return s1.compareTo(s2);
- }
- }
- );
- }
- return names;
- }
-
- private Map internalQueryFailure(String scenarioPattern, Variations variations) {
- if (fSQL == null)
- return null;
- long start = System.currentTimeMillis();
- if (DEBUG) System.out.print(" - query failure from DB for scenario pattern '"+scenarioPattern+"'..."); //$NON-NLS-1$ //$NON-NLS-2$
- ResultSet result= null;
- try {
- Map map= new HashMap();
- result= fSQL.queryFailure(variations, scenarioPattern);
- while (result.next()) {
- String scenario= result.getString(1);
- String message= result.getString(2);
- map.put(scenario, message);
- }
- return map;
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
-
- } finally {
- if (result != null) {
- try {
- result.close();
- } catch (SQLException e1) {
- // ignored
- }
- }
- if (DEBUG) {
- long time = System.currentTimeMillis();
- System.out.println("done in "+(time-start)+"ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return null;
- }
-
- /**
- * dbloc= embed in home directory
- * dbloc=/tmp/performance embed given location
- * dbloc=net://localhost connect to local server
- * dbloc=net://www.eclipse.org connect to remove server
- */
- private void connect() {
-
- if (fConnection != null)
- return;
-
- if (DEBUG) DriverManager.setLogWriter(new PrintWriter(System.out));
- String dbloc= PerformanceTestPlugin.getDBLocation();
- if (dbloc == null)
- return;
-
- String dbname= PerformanceTestPlugin.getDBName();
- String url= null;
- java.util.Properties info= new java.util.Properties();
-
- fDBType= DERBY; // assume we are using Derby
- try {
- if (dbloc.startsWith("net://")) { //$NON-NLS-1$
- // remote
- fIsEmbedded= false;
- // connect over network
- if (DEBUG) System.out.println("Trying to connect over network..."); //$NON-NLS-1$
-// Class.forName(" org.apache.derby.jdbc.ClientDriver"); //$NON-NLS-1$
- Class.forName("com.ibm.db2.jcc.DB2Driver"); //$NON-NLS-1$
- info.put("user", PerformanceTestPlugin.getDBUser()); //$NON-NLS-1$
- info.put("password", PerformanceTestPlugin.getDBPassword()); //$NON-NLS-1$
- info.put("retrieveMessagesFromServerOnGetMessage", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- url= dbloc + "/" + dbname + ";create=true"; //$NON-NLS-1$//$NON-NLS-2$
- } else if (dbloc.startsWith("//")) { //$NON-NLS-1$
- // remote
- fIsEmbedded = false;
- // connect over network
- if (DEBUG)
- System.out.println("Trying to connect over network..."); //$NON-NLS-1$
- Class.forName("org.apache.derby.jdbc.ClientDriver"); //$NON-NLS-1$
- info.put("user", PerformanceTestPlugin.getDBUser()); //$NON-NLS-1$
- info.put("password", PerformanceTestPlugin.getDBPassword()); //$NON-NLS-1$
- info.put("create", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- url = dbloc + '/' + dbname;
- } else {
-
- // workaround for Derby issue: http://nagoya.apache.org/jira/browse/DERBY-1
- if ("Mac OS X".equals(System.getProperty("os.name"))) //$NON-NLS-1$//$NON-NLS-2$
- System.setProperty("derby.storage.fileSyncTransactionLog", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // embedded
- fIsEmbedded= true;
- try {
- Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); //$NON-NLS-1$
- } catch (ClassNotFoundException e) {
- Class.forName("com.ihost.cs.jdbc.CloudscapeDriver"); //$NON-NLS-1$
- fDBType= CLOUDSCAPE;
- }
- if (DEBUG) System.out.println("Loaded embedded " + fDBType); //$NON-NLS-1$
- File f;
- if (dbloc.length() == 0) {
- String user_home= System.getProperty("user.home"); //$NON-NLS-1$
- if (user_home == null)
- return;
- f= new File(user_home, fDBType);
- } else
- f= new File(dbloc);
- url= new File(f, dbname).getAbsolutePath();
- info.put("user", PerformanceTestPlugin.getDBUser()); //$NON-NLS-1$
- info.put("password", PerformanceTestPlugin.getDBPassword()); //$NON-NLS-1$
- info.put("create", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- try {
- fConnection= DriverManager.getConnection("jdbc:" + fDBType + ":" + url, info); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (SQLException e) {
- if ("08001".equals(e.getSQLState()) && DERBY.equals(fDBType)) { //$NON-NLS-1$
- if (DEBUG) System.out.println("DriverManager.getConnection failed; retrying for cloudscape"); //$NON-NLS-1$
- // try Cloudscape
- fDBType= CLOUDSCAPE;
- fConnection= DriverManager.getConnection("jdbc:" + fDBType + ":" + url, info); //$NON-NLS-1$ //$NON-NLS-2$
- } else
- throw e;
- }
- if (DEBUG) System.out.println("connect succeeded!"); //$NON-NLS-1$
-
- fConnection.setAutoCommit(false);
- fSQL= new SQL(fConnection);
- fConnection.commit();
-
- } catch (SQLException ex) {
- PerformanceTestPlugin.logError(ex.getMessage());
-
- } catch (ClassNotFoundException e) {
- PerformanceTestPlugin.log(e);
- }
- }
-
- private void disconnect() {
- if (DEBUG) {
- if (fStoreCalled)
- System.out.println("stored " + fStoredSamples + " new datapoints in DB"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("disconnecting from DB"); //$NON-NLS-1$
- }
- if (fSQL != null) {
- try {
- fSQL.dispose();
- } catch (SQLException e1) {
- PerformanceTestPlugin.log(e1);
- }
- fSQL= null;
- }
- if (fConnection != null) {
- try {
- fConnection.commit();
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
- }
- try {
- fConnection.close();
- } catch (SQLException e) {
- PerformanceTestPlugin.log(e);
- }
- fConnection= null;
- }
-
- if (fIsEmbedded) {
- try {
- DriverManager.getConnection("jdbc:" + fDBType + ":;shutdown=true"); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (SQLException e) {
- String message= e.getMessage();
- if (message.indexOf("system shutdown.") < 0) //$NON-NLS-1$
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DBHelpers.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DBHelpers.java
deleted file mode 100755
index f9bc656aa..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/DBHelpers.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import java.io.PrintStream;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.Dim;
-
-
-public class DBHelpers {
-
- private Connection fConnection;
-
-
- public static void main(String[] args) throws SQLException {
-
- //System.setProperty("eclipse.perf.dbloc", "net://localhost");
-
- DBHelpers db= new DBHelpers();
-
- long start= System.currentTimeMillis();
-
-
- db.dumpSizes(System.out);
- //db.renameVariation("|build=3.0.0_200410130800||config=relengbuildwin2|", "|build=3.0.0_200406251208_200410130800||config=relengbuildwin2|");
- //db.dumpTable(ps, "VARIATION", 1000); //$NON-NLS-1$
- //db.countSamplesWithNullVariations();
-
- //Variations v= new Variations();
- //v.put(PerformanceTestPlugin.CONFIG, "relengbuildwin2"); //$NON-NLS-1$
- //v.put(PerformanceTestPlugin.BUILD, "I20041104%"); //$NON-NLS-1$
-
- //db.dumpSummaries(v, null);
- //db.removeSamples(v);
- //db.countSamples(ps, v);
- //db.view(ps, v, "org.eclipse.jdt.core.tests.performance.FullSourceWorkspaceTests#testPerfFullBuild()");
-
-
- System.out.println("time: " + ((System.currentTimeMillis()-start)/1000.0)); //$NON-NLS-1$
- }
-
- public DBHelpers() {
- fConnection= DB.getConnection();
- }
-
- void renameVariation(String oldName, String newName) throws SQLException {
- PreparedStatement update= fConnection.prepareStatement("update VARIATION set KEYVALPAIRS = ? where KEYVALPAIRS = ? "); //$NON-NLS-1$
- update.setString(1, newName);
- update.setString(2, oldName);
- update.executeUpdate();
- update.close();
- }
-
- void dumpSummaries(Variations variations, String scenarioPattern) {
- SummaryEntry[] summries= DB.querySummaries(variations, scenarioPattern);
- for (int i= 0; i < summries.length; i++)
- System.out.println(summries[i]);
- }
-
- void count(PrintStream ps) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select count(*) from SCALAR where DATAPOINT_ID not in (select DATAPOINT.ID from DATAPOINT)"); //$NON-NLS-1$
- ResultSet set= stmt.executeQuery();
- if (set.next())
- ps.println("count: " + set.getInt(1)); //$NON-NLS-1$
- set.close();
- stmt.close();
- }
-
- void countDimension(PrintStream ps, Dim dim) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select count(*) from SCALAR where DIM_ID = ?"); //$NON-NLS-1$
- stmt.setInt(1, dim.getId());
- ResultSet set= stmt.executeQuery();
- if (set.next())
- ps.println("dimension " + dim + ": " + set.getInt(1)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- void countAllDimensions(PrintStream ps) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select distinct DIM_ID from SCALAR"); //$NON-NLS-1$
- ResultSet set= stmt.executeQuery();
- while (set.next()) {
- Dim dimension= Dim.getDimension(set.getInt(1));
- if (dimension != null)
- countDimension(ps, dimension);
- }
- }
-
- int countSamples(PrintStream ps, Variations v) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select count(*) from SAMPLE, VARIATION where VARIATION.KEYVALPAIRS = ? and SAMPLE.VARIATION_ID = VARIATION.ID"); //$NON-NLS-1$
- stmt.setString(1, v.toExactMatchString());
- ResultSet set= stmt.executeQuery();
- int n= 0;
- if (set.next())
- n= set.getInt(1);
- ps.println("samples with variation " + v + ": " + n); //$NON-NLS-1$ //$NON-NLS-2$
- return n;
- }
-
- void countDatapoints(PrintStream ps, Variations v) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select count(*) from DATAPOINT, SAMPLE, VARIATION where VARIATION.KEYVALPAIRS = ? and SAMPLE.VARIATION_ID = VARIATION.ID and DATAPOINT.SAMPLE_ID= SAMPLE.ID"); //$NON-NLS-1$
- stmt.setString(1, v.toExactMatchString());
- ResultSet set= stmt.executeQuery();
- if (set.next())
- ps.println("datapoints with variation " + v + ": " + set.getInt(1)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- void countScalars(PrintStream ps, Variations v) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select count(*) from SCALAR, DATAPOINT, SAMPLE, VARIATION where VARIATION.KEYVALPAIRS = ? and SAMPLE.VARIATION_ID = VARIATION.ID and DATAPOINT.SAMPLE_ID= SAMPLE.ID and DATAPOINT.ID = SCALAR.DATAPOINT_ID"); //$NON-NLS-1$
- stmt.setString(1, v.toExactMatchString());
- ResultSet set= stmt.executeQuery();
- if (set.next())
- ps.println("scalars with variation " + v + ": " + set.getInt(1)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- void removeSamples(Variations v) throws SQLException {
-
- boolean delete= true;
-
- int n= countSamples(System.out, v);
-
- int variation_id= 0;
- PreparedStatement stmt= fConnection.prepareStatement("select ID from VARIATION where KEYVALPAIRS = ?"); //$NON-NLS-1$
- stmt.setString(1, v.toExactMatchString());
- ResultSet set= stmt.executeQuery();
- if (set.next()) {
- variation_id= set.getInt(1);
- System.err.println("variation_id: " + variation_id); //$NON-NLS-1$
- }
-
- if (variation_id <= 0) {
- System.err.println("nothing found for variation " + v); //$NON-NLS-1$
- return;
- }
-
- PreparedStatement iterSamples= fConnection.prepareStatement("select SAMPLE.ID, SAMPLE.SCENARIO_ID from SAMPLE where SAMPLE.VARIATION_ID = ?"); //$NON-NLS-1$
- PreparedStatement iterDatapoints= fConnection.prepareStatement("select DATAPOINT.ID from DATAPOINT where DATAPOINT.SAMPLE_ID = ?"); //$NON-NLS-1$
-
- PreparedStatement deleteScalars= fConnection.prepareStatement("delete from SCALAR where DATAPOINT_ID = ?"); //$NON-NLS-1$
- PreparedStatement deleteDatapoints= fConnection.prepareStatement("delete from DATAPOINT where SAMPLE_ID = ?"); //$NON-NLS-1$
- PreparedStatement deleteSamples= fConnection.prepareStatement("delete from SAMPLE where SAMPLE.ID = ?"); //$NON-NLS-1$
- PreparedStatement deleteScenario= fConnection.prepareStatement("delete from SCENARIO where SCENARIO.ID = ?"); //$NON-NLS-1$
-
- ResultSet samples= null, datapoints= null;
- iterSamples.setInt(1, variation_id);
- samples= iterSamples.executeQuery();
- while (samples.next()) {
- int sample_id= samples.getInt(1);
- int scenario_id= samples.getInt(2);
- System.out.print(n + ": sample(" + sample_id + "):"); //$NON-NLS-1$ //$NON-NLS-2$
- iterDatapoints.setInt(1, sample_id);
- datapoints= iterDatapoints.executeQuery();
- int dps= 0;
- while (datapoints.next()) {
- int dp_id= datapoints.getInt(1);
- //ps.println(" dp: " + dp_id); //$NON-NLS-1$
- if (delete) {
- deleteScalars.setInt(1, dp_id);
- try {
- deleteScalars.executeUpdate();
- fConnection.commit();
- dps++;
- } catch (SQLException e) {
- System.err.println("removing scalars: " + e); //$NON-NLS-1$
- }
- }
- }
- System.out.println(" dps: " + dps); //$NON-NLS-1$
- if (delete) {
- deleteDatapoints.setInt(1, sample_id);
- try {
- deleteDatapoints.executeUpdate();
- fConnection.commit();
- } catch (SQLException e1) {
- System.err.println("removing datapoints: " + e1); //$NON-NLS-1$
- }
-
- deleteSamples.setInt(1, sample_id);
- try {
- deleteSamples.executeUpdate();
- fConnection.commit();
- } catch (SQLException e) {
- System.err.println("removing sample: " + e); //$NON-NLS-1$
- }
-
- deleteScenario.setInt(1, scenario_id);
- try {
- deleteScenario.executeUpdate();
- fConnection.commit();
- } catch (SQLException e) {
- // System.err.println("removing scenario: " + e); //$NON-NLS-1$
- }
- }
- n--;
- }
- if (delete) {
- PreparedStatement deleteSummaries= fConnection.prepareStatement("delete from SUMMARYENTRY where VARIATION_ID = ?"); //$NON-NLS-1$
- deleteSummaries.setInt(1, variation_id);
- deleteSummaries.executeUpdate();
- deleteSummaries.close();
-
- PreparedStatement deleteVariation= fConnection.prepareStatement("delete from VARIATION where ID = ?"); //$NON-NLS-1$
- deleteVariation.setInt(1, variation_id);
- try {
- deleteVariation.executeUpdate();
- } catch (SQLException e) {
- System.err.println("removing variation: " + e); //$NON-NLS-1$
- }
- deleteVariation.close();
- }
-
- if (samples != null) samples.close();
- if (datapoints != null) datapoints.close();
-
- if (iterSamples != null) iterSamples.close();
- if (iterDatapoints != null) iterDatapoints.close();
-
- if (deleteSamples != null) deleteSamples.close();
- if (deleteScenario != null) deleteScenario.close();
- if (deleteScalars != null) deleteScalars.close();
- if (deleteDatapoints != null) deleteDatapoints.close();
- }
-
- void countSamplesWithNullVariations() throws SQLException {
- Statement stmt= fConnection.createStatement();
- ResultSet rs= stmt.executeQuery("select count(*) from SAMPLE where SAMPLE.VARIATION_ID is null"); //$NON-NLS-1$
- while (rs.next()) {
- int config_id= rs.getInt(1);
- System.out.println("samples with NULL variation: " + config_id); //$NON-NLS-1$
- }
- rs.close();
- stmt.close();
- }
-
- void removeDimension(Dim dim) throws SQLException {
- PreparedStatement q= fConnection.prepareStatement("delete from SCALAR where SCALAR.DIM_ID = ?"); //$NON-NLS-1$
- q.setInt(1, dim.getId());
- q.executeUpdate();
- q.close();
- }
-
- void dumpScenarios(PrintStream ps, String pattern) throws SQLException {
- PreparedStatement stmt= fConnection.prepareStatement("select NAME from SCENARIO where NAME like ? order by NAME"); //$NON-NLS-1$
- stmt.setString(1, pattern);
- ResultSet rs= stmt.executeQuery();
- while (rs.next())
- ps.println(rs.getString(1));
- rs.close();
- stmt.close();
- }
-
- void dumpSizes(PrintStream ps) throws SQLException {
- if (fConnection == null)
- return;
- Statement stmt= fConnection.createStatement();
- try {
- ResultSet rs= stmt.executeQuery("SELECT sys.systables.tablename FROM sys.systables WHERE sys.systables.tablename NOT LIKE 'SYS%' "); //$NON-NLS-1$
- while (rs.next())
- dumpSize(ps, rs.getString(1));
- rs.close();
- } finally {
- stmt.close();
- }
- }
-
- void dumpSize(PrintStream ps, String table) throws SQLException {
- Statement stmt= fConnection.createStatement();
- ResultSet rs= stmt.executeQuery("select Count(*) from " + table); //$NON-NLS-1$
- if (rs.next())
- ps.println(table + ": " + rs.getInt(1)); //$NON-NLS-1$
- rs.close();
- stmt.close();
- }
-
- public void dumpAll(PrintStream ps, int maxRow) throws SQLException {
- if (fConnection == null)
- return;
- if (maxRow < 0)
- maxRow= 1000000;
- Statement stmt= fConnection.createStatement();
- try {
- ResultSet rs= stmt.executeQuery("select SYS.SYSTABLES.TABLENAME from SYS.SYSTABLES where SYS.SYSTABLES.TABLENAME not like 'SYS%' "); //$NON-NLS-1$
- while (rs.next()) {
- dumpTable(ps, rs.getString(1), maxRow);
- ps.println();
- }
- rs.close();
- } finally {
- stmt.close();
- }
- }
-
- void dumpTable(PrintStream ps, String tableName, int maxRow) throws SQLException {
- ps.print(tableName + '(');
- Statement select= fConnection.createStatement();
- ResultSet result= select.executeQuery("select * from " + tableName); //$NON-NLS-1$
- ResultSetMetaData metaData= result.getMetaData();
- int n= metaData.getColumnCount();
- for (int i= 0; i < n; i++) {
- ps.print(metaData.getColumnLabel(i+1));
- if (i < n-1)
- ps.print(", "); //$NON-NLS-1$
- }
- ps.println("):"); //$NON-NLS-1$
- for (int r= 0; result.next() && r < maxRow; r++) {
- for (int i= 0; i < n; i++)
- ps.print(' ' + result.getString(i+1));
- ps.println();
- }
- select.close();
- }
-
- void view(PrintStream ps, Variations v, String scenarioPattern) throws SQLException {
- Scenario[] scenarios= DB.queryScenarios(v, scenarioPattern, PerformanceTestPlugin.BUILD, null);
- ps.println(scenarios.length + " Scenarios"); //$NON-NLS-1$
- ps.println();
- for (int s= 0; s < scenarios.length; s++)
- scenarios[s].dump(ps, PerformanceTestPlugin.BUILD);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Report.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Report.java
deleted file mode 100755
index 6c1bc10d2..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Report.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import java.io.PrintStream;
-import java.util.HashMap;
-
-public class Report {
-
- private static final String LEFT= "l"; //$NON-NLS-1$
- private static final String RIGHT= "r"; //$NON-NLS-1$
-
- private int fGap;
- private int fColumn;
- private int fRow;
- private int fRows;
- private HashMap fContent= new HashMap();
- private HashMap fWidths= new HashMap();
- private HashMap fAlignment= new HashMap();
-
- public Report(int gap) {
- fGap= gap;
- }
-
- public void addCell(String value) {
- setCell(fColumn, fRow, value, LEFT);
- fColumn++;
- }
-
- public void addCellRight(String value) {
- setCell(fColumn, fRow, value, RIGHT);
- fColumn++;
- }
-
- public void nextRow() {
- fRow++;
- fColumn= 0;
- }
-
- private void setCell(int x, int y, String value, String align) {
- fContent.put(x + "/" + y, value); //$NON-NLS-1$
- fAlignment.put(x + "/" + y, align); //$NON-NLS-1$
- Integer w= (Integer) fWidths.get(Integer.toString(x));
- if (w == null)
- w= new Integer(value.length());
- else
- w= new Integer(Math.max(w.intValue(), value.length()));
- fWidths.put(Integer.toString(x), w);
- fRows= Math.max(fRows, y+1);
- }
-
- private String getCell(int x, int y) {
- return (String) fContent.get(x + "/" + y); //$NON-NLS-1$
- }
-
- public void print(PrintStream ps) {
- int n= fWidths.size();
- for (int y= 0; y < fRows; y++) {
- for (int x= 0; x < n; x++) {
- Integer w= (Integer) fWidths.get(Integer.toString(x));
- int ww= w.intValue();
- String s= getCell(x, y);
- if (s == null)
- s= ""; //$NON-NLS-1$
-
- if (x > 0)
- for (int g= 0; g < fGap; g++)
- ps.print(' ');
-
- int www= ww-s.length();
- String align= (String) fAlignment.get(x + "/" + y); //$NON-NLS-1$
- if (LEFT.equalsIgnoreCase(align))
- ps.print(s);
- for (int l= 0; l < www; l++)
- ps.print(' ');
- if (RIGHT.equalsIgnoreCase(align))
- ps.print(s);
- }
- ps.println();
- }
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SQL.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SQL.java
deleted file mode 100755
index d056f4b29..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SQL.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import java.math.BigDecimal;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Timestamp;
-
-/*
- * Any SQL should only be used here.
- */
-public class SQL {
-
- private boolean fCompatibility= false;
-
- protected Connection fConnection;
-
- private PreparedStatement fInsertVariation, fInsertScenario, fInsertSample, fInsertDataPoint, fInsertScalar;
- private PreparedStatement fQueryComment, fInsertComment, fQueryComment2;
- private PreparedStatement fQueryVariation, fQueryVariations, fQueryScenario, fQueryAllScenarios, fQueryDatapoints,
- fQueryScalars;
- private PreparedStatement fInsertSummaryEntry, fUpdateScenarioShortName, fQuerySummaryEntry, fQueryGlobalSummaryEntries,
- fQuerySummaryEntries;
- private PreparedStatement fInsertFailure, fQueryFailure;
-
- protected SQL(Connection con) throws SQLException {
- fConnection= con;
-
- boolean needsUpgrade= true;
- boolean needsInitialization= true;
- boolean needsFailures= true;
- boolean needsComments= true;
-
- Statement statement= fConnection.createStatement();
- ResultSet rs= statement.executeQuery("select SYS.SYSTABLES.TABLENAME from SYS.SYSTABLES where SYS.SYSTABLES.TABLENAME not like 'SYS%'"); //$NON-NLS-1$
- while (rs.next()) {
- String tablename= rs.getString(1);
- if ("SUMMARYENTRY".equals(tablename)) //$NON-NLS-1$
- needsUpgrade= false;
- else if ("CONFIG_ORG".equals(tablename)) //$NON-NLS-1$
- fCompatibility= true;
- else if ("VARIATION".equals(tablename)) //$NON-NLS-1$
- needsInitialization= false;
- else if ("FAILURE".equals(tablename)) //$NON-NLS-1$
- needsFailures= false;
- else if ("COMMENT".equals(tablename)) //$NON-NLS-1$
- needsComments= false;
- }
- if (!fCompatibility) {
- // check whether table SAMPLE still has the CONFIG_ID column
- rs= statement.executeQuery("select count(*) from SYS.SYSTABLES, SYS.SYSCOLUMNS where SYS.SYSTABLES.TABLENAME = 'SAMPLE' and " + //$NON-NLS-1$
- "SYS.SYSTABLES.TABLEID = SYS.SYSCOLUMNS.REFERENCEID and SYS.SYSCOLUMNS.COLUMNNAME = 'CONFIG_ID' "); //$NON-NLS-1$
- if (rs.next() && rs.getInt(1) == 1)
- fCompatibility= true;
- }
-
- if (needsInitialization)
- initialize();
- else {
- if (needsUpgrade)
- upgradeDB();
- else if (needsFailures)
- addFailureTable();
- if (needsComments)
- addCommentTable();
- }
- }
-
- protected void dispose() throws SQLException {
- if (fInsertVariation != null)
- fInsertVariation.close();
- if (fInsertScenario != null)
- fInsertScenario.close();
- if (fInsertSample != null)
- fInsertSample.close();
- if (fInsertDataPoint != null)
- fInsertDataPoint.close();
- if (fInsertScalar != null)
- fInsertScalar.close();
- if (fInsertSummaryEntry != null)
- fInsertSummaryEntry.close();
- if (fInsertFailure != null)
- fInsertFailure.close();
- if (fInsertComment != null)
- fInsertComment.close();
- if (fUpdateScenarioShortName != null)
- fUpdateScenarioShortName.close();
- if (fQueryDatapoints != null)
- fQueryDatapoints.close();
- if (fQueryScalars != null)
- fQueryScalars.close();
- if (fQueryVariation != null)
- fQueryVariation.close();
- if (fQueryScenario != null)
- fQueryScenario.close();
- if (fQueryAllScenarios != null)
- fQueryAllScenarios.close();
- if (fQueryVariations != null)
- fQueryVariations.close();
- if (fQueryGlobalSummaryEntries != null)
- fQueryGlobalSummaryEntries.close();
- if (fQuerySummaryEntries != null)
- fQuerySummaryEntries.close();
- if (fQueryFailure != null)
- fQueryFailure.close();
- if (fQueryComment != null)
- fQueryComment.close();
- if (fQueryComment2 != null)
- fQueryComment2.close();
- }
-
- private void initialize() throws SQLException {
- Statement stmt= null;
- try {
- stmt= fConnection.createStatement();
- stmt.executeUpdate("create table VARIATION (" + //$NON-NLS-1$
- "ID int unique not null GENERATED ALWAYS AS IDENTITY," + //$NON-NLS-1$
- "KEYVALPAIRS varchar(10000) not null " + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table SCENARIO (" + //$NON-NLS-1$
- "ID int unique not null GENERATED ALWAYS AS IDENTITY," + //$NON-NLS-1$
- "NAME varchar(256) not null," + //$NON-NLS-1$
- "SHORT_NAME varchar(40)" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table SAMPLE (" + //$NON-NLS-1$
- "ID int not null GENERATED ALWAYS AS IDENTITY," + //$NON-NLS-1$
- "VARIATION_ID int not null," + //$NON-NLS-1$
- "SCENARIO_ID int not null," + //$NON-NLS-1$
- "STARTTIME timestamp" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table DATAPOINT (" + //$NON-NLS-1$
- "ID int not null GENERATED ALWAYS AS IDENTITY," + //$NON-NLS-1$
- "SAMPLE_ID int not null," + //$NON-NLS-1$
- "SEQ int," + //$NON-NLS-1$
- "STEP int" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table SCALAR (" + //$NON-NLS-1$
- "DATAPOINT_ID int not null," + //$NON-NLS-1$
- "DIM_ID int not null," + //$NON-NLS-1$
- "VALUE bigint" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table SUMMARYENTRY (" + //$NON-NLS-1$
- "VARIATION_ID int not null," + //$NON-NLS-1$
- "SCENARIO_ID int not null," + //$NON-NLS-1$
- "DIM_ID int not null," + //$NON-NLS-1$
- "IS_GLOBAL smallint not null," + //$NON-NLS-1$
- "COMMENT_ID int not null" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table FAILURE (" + //$NON-NLS-1$
- "VARIATION_ID int not null," + //$NON-NLS-1$
- "SCENARIO_ID int not null," + //$NON-NLS-1$
- "MESSAGE varchar(1000) not null" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("create table COMMENT (" + //$NON-NLS-1$
- "ID int unique not null GENERATED ALWAYS AS IDENTITY," + //$NON-NLS-1$
- "KIND int not null," + //$NON-NLS-1$
- "TEXT varchar(400) not null" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
-
- // Primary/unique
- stmt.executeUpdate("alter table VARIATION add constraint VA_KVP primary key (KEYVALPAIRS)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table SCENARIO add constraint SC_NAME primary key (NAME)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table SAMPLE add constraint SA_ID primary key (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table DATAPOINT add constraint DP_ID primary key (ID)"); //$NON-NLS-1$
-
- // Foreign
- stmt.executeUpdate("alter table SAMPLE add constraint SAMPLE_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (VARIATION_ID) references VARIATION (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table SAMPLE add constraint SAMPLE_CONSTRAINT2 " + //$NON-NLS-1$
- "foreign key (SCENARIO_ID) references SCENARIO (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table DATAPOINT add constraint DP_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (SAMPLE_ID) references SAMPLE (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table SCALAR add constraint SCALAR_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (DATAPOINT_ID) references DATAPOINT (ID)"); //$NON-NLS-1$
-
- stmt.executeUpdate("alter table SUMMARYENTRY add constraint FP_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (VARIATION_ID) references VARIATION (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table SUMMARYENTRY add constraint FP_CONSTRAINT2 " + //$NON-NLS-1$
- "foreign key (SCENARIO_ID) references SCENARIO (ID)"); //$NON-NLS-1$
-
- stmt.executeUpdate("alter table FAILURE add constraint FA_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (VARIATION_ID) references VARIATION (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table FAILURE add constraint FA_CONSTRAINT2 " + //$NON-NLS-1$
- "foreign key (SCENARIO_ID) references SCENARIO (ID)"); //$NON-NLS-1$
-
- fConnection.commit();
-
- } finally {
- if (stmt != null)
- stmt.close();
- }
- }
-
- private void upgradeDB() throws SQLException {
- Statement stmt= null;
- try {
- stmt= fConnection.createStatement();
-
- stmt.executeUpdate("create table SUMMARYENTRY (" + //$NON-NLS-1$
- "VARIATION_ID int not null," + //$NON-NLS-1$
- "SCENARIO_ID int not null," + //$NON-NLS-1$
- "DIM_ID int not null," + //$NON-NLS-1$
- "IS_GLOBAL smallint not null," + //$NON-NLS-1$
- "COMMENT_ID int not null" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
- stmt.executeUpdate("alter table SUMMARYENTRY add constraint FP_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (VARIATION_ID) references VARIATION (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table SUMMARYENTRY add constraint FP_CONSTRAINT2 " + //$NON-NLS-1$
- "foreign key (SCENARIO_ID) references SCENARIO (ID)"); //$NON-NLS-1$
-
- stmt.executeUpdate("alter table SCENARIO add column SHORT_NAME varchar(40)"); //$NON-NLS-1$
-
- fConnection.commit();
-
- } finally {
- if (stmt != null)
- stmt.close();
- }
- }
-
- private void addCommentTable() throws SQLException {
- Statement stmt= null;
- try {
- stmt= fConnection.createStatement();
-
- stmt.executeUpdate("create table COMMENT (" + //$NON-NLS-1$
- "ID int unique not null GENERATED ALWAYS AS IDENTITY," + //$NON-NLS-1$
- "KIND int not null," + //$NON-NLS-1$
- "TEXT varchar(400) not null" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
-
- stmt.executeUpdate("alter table SUMMARYENTRY add column COMMENT_ID int not null default 0"); //$NON-NLS-1$
-
- fConnection.commit();
-
- } finally {
- if (stmt != null)
- stmt.close();
- }
- }
-
- private void addFailureTable() throws SQLException {
- Statement stmt= null;
- try {
- stmt= fConnection.createStatement();
-
- stmt.executeUpdate("create table FAILURE (" + //$NON-NLS-1$
- "VARIATION_ID int not null," + //$NON-NLS-1$
- "SCENARIO_ID int not null," + //$NON-NLS-1$
- "MESSAGE varchar(1000) not null" + //$NON-NLS-1$
- ")" //$NON-NLS-1$
- );
-
- stmt.executeUpdate("alter table FAILURE add constraint FA_CONSTRAINT " + //$NON-NLS-1$
- "foreign key (VARIATION_ID) references VARIATION (ID)"); //$NON-NLS-1$
- stmt.executeUpdate("alter table FAILURE add constraint FA_CONSTRAINT2 " + //$NON-NLS-1$
- "foreign key (SCENARIO_ID) references SCENARIO (ID)"); //$NON-NLS-1$
-
- fConnection.commit();
-
- } finally {
- if (stmt != null)
- stmt.close();
- }
- }
-
- static int create(PreparedStatement stmt) throws SQLException {
- stmt.executeUpdate();
- ResultSet rs= stmt.getGeneratedKeys();
- if (rs != null) {
- try {
- if (rs.next()) {
- BigDecimal idColVar= rs.getBigDecimal(1);
- return idColVar.intValue();
- }
- } finally {
- rs.close();
- }
- }
- return 0;
- }
-
- int getScenario(String scenarioPattern) throws SQLException {
- if (fQueryScenario == null)
- fQueryScenario= fConnection.prepareStatement("select ID from SCENARIO where NAME = ?"); //$NON-NLS-1$
- fQueryScenario.setString(1, scenarioPattern);
- ResultSet result= fQueryScenario.executeQuery();
- while (result.next())
- return result.getInt(1);
-
- if (fInsertScenario == null)
- fInsertScenario= fConnection.prepareStatement("insert into SCENARIO (NAME) values (?)", Statement.RETURN_GENERATED_KEYS); //$NON-NLS-1$
- fInsertScenario.setString(1, scenarioPattern);
- return create(fInsertScenario);
- }
-
- int getVariations(Variations variations) throws SQLException {
- if (fQueryVariation == null)
- fQueryVariation= fConnection.prepareStatement("select ID from VARIATION where KEYVALPAIRS = ?"); //$NON-NLS-1$
- String exactMatchString= variations.toExactMatchString();
- fQueryVariation.setString(1, exactMatchString);
- ResultSet result= fQueryVariation.executeQuery();
- while (result.next())
- return result.getInt(1);
-
- if (fInsertVariation == null)
- fInsertVariation= fConnection.prepareStatement("insert into VARIATION (KEYVALPAIRS) values (?)", Statement.RETURN_GENERATED_KEYS); //$NON-NLS-1$
- fInsertVariation.setString(1, exactMatchString);
- return create(fInsertVariation);
- }
-
- int createSample(int variation_id, int scenario_id, Timestamp starttime) throws SQLException {
- if (fInsertSample == null) {
- if (fCompatibility) {
- // since we cannot remove table columns in cloudscape we have to
- // provide a non-null value for CONFIG_ID
- fInsertSample= fConnection.prepareStatement("insert into SAMPLE (VARIATION_ID, SCENARIO_ID, STARTTIME, CONFIG_ID) values (?, ?, ?, 0)", Statement.RETURN_GENERATED_KEYS); //$NON-NLS-1$
- } else {
- fInsertSample= fConnection.prepareStatement("insert into SAMPLE (VARIATION_ID, SCENARIO_ID, STARTTIME) values (?, ?, ?)", Statement.RETURN_GENERATED_KEYS); //$NON-NLS-1$
- }
- }
- fInsertSample.setInt(1, variation_id);
- fInsertSample.setInt(2, scenario_id);
- fInsertSample.setTimestamp(3, starttime);
- return create(fInsertSample);
- }
-
- int createDataPoint(int sample_id, int seq, int step) throws SQLException {
- if (fInsertDataPoint == null)
- fInsertDataPoint= fConnection.prepareStatement("insert into DATAPOINT (SAMPLE_ID, SEQ, STEP) values (?, ?, ?)", Statement.RETURN_GENERATED_KEYS); //$NON-NLS-1$
- fInsertDataPoint.setInt(1, sample_id);
- fInsertDataPoint.setInt(2, seq);
- fInsertDataPoint.setInt(3, step);
- return create(fInsertDataPoint);
- }
-
- void insertScalar(int datapoint_id, int dim_id, long value) throws SQLException {
- if (fInsertScalar == null)
- fInsertScalar= fConnection.prepareStatement("insert into SCALAR values (?, ?, ?)"); //$NON-NLS-1$
- fInsertScalar.setInt(1, datapoint_id);
- fInsertScalar.setInt(2, dim_id);
- fInsertScalar.setLong(3, value);
- fInsertScalar.executeUpdate();
- }
-
- ResultSet queryDataPoints(Variations variations, String scenarioName) throws SQLException {
- if (fQueryDatapoints == null)
- fQueryDatapoints= fConnection.prepareStatement("select DATAPOINT.ID, DATAPOINT.STEP from VARIATION, SCENARIO, SAMPLE, DATAPOINT " + //$NON-NLS-1$
- "where " + //$NON-NLS-1$
- "SAMPLE.VARIATION_ID = VARIATION.ID and VARIATION.KEYVALPAIRS = ? and " + //$NON-NLS-1$
- "SAMPLE.SCENARIO_ID = SCENARIO.ID and SCENARIO.NAME LIKE ? and " + //$NON-NLS-1$
- "DATAPOINT.SAMPLE_ID = SAMPLE.ID " //$NON-NLS-1$
- );
- fQueryDatapoints.setString(1, variations.toExactMatchString());
- fQueryDatapoints.setString(2, scenarioName);
- return fQueryDatapoints.executeQuery();
- }
-
- ResultSet queryScalars(int datapointId) throws SQLException {
- if (fQueryScalars == null)
- fQueryScalars= fConnection.prepareStatement("select SCALAR.DIM_ID, SCALAR.VALUE from SCALAR where SCALAR.DATAPOINT_ID = ?"); //$NON-NLS-1$
- fQueryScalars.setInt(1, datapointId);
- return fQueryScalars.executeQuery();
- }
-
- /*
- * Returns SCENARIO.NAME
- */
- ResultSet queryScenarios(Variations variations, String scenarioPattern) throws SQLException {
- if (fQueryAllScenarios == null)
- fQueryAllScenarios= fConnection.prepareStatement("select distinct SCENARIO.NAME from SCENARIO, SAMPLE, VARIATION where " + //$NON-NLS-1$
- "SAMPLE.VARIATION_ID = VARIATION.ID and VARIATION.KEYVALPAIRS LIKE ? and " + //$NON-NLS-1$
- "SAMPLE.SCENARIO_ID = SCENARIO.ID and SCENARIO.NAME LIKE ?" //$NON-NLS-1$
- );
- fQueryAllScenarios.setString(1, variations.toQueryPattern());
- fQueryAllScenarios.setString(2, scenarioPattern);
- return fQueryAllScenarios.executeQuery();
- }
-
- /*
- * Returns VARIATION.KEYVALPAIRS
- */
- ResultSet queryVariations(String variations, String scenarioPattern) throws SQLException {
- if (fQueryVariations == null)
- fQueryVariations= fConnection.prepareStatement("select distinct VARIATION.KEYVALPAIRS from VARIATION, SAMPLE, SCENARIO where " + //$NON-NLS-1$
- "SAMPLE.VARIATION_ID = VARIATION.ID and VARIATION.KEYVALPAIRS LIKE ? and " + //$NON-NLS-1$
- "SAMPLE.SCENARIO_ID = SCENARIO.ID and SCENARIO.NAME LIKE ?" //$NON-NLS-1$
- );
- fQueryVariations.setString(1, variations);
- fQueryVariations.setString(2, scenarioPattern);
- return fQueryVariations.executeQuery();
- }
-
- void createSummaryEntry(int variation_id, int scenario_id, int dim_id, boolean isGlobal, int comment_id) throws SQLException {
- if (fQuerySummaryEntry == null)
- fQuerySummaryEntry= fConnection.prepareStatement(
- "select count(*) from SUMMARYENTRY where VARIATION_ID = ? and SCENARIO_ID = ? and DIM_ID = ? and IS_GLOBAL = ? and COMMENT_ID = ?"); //$NON-NLS-1$
- fQuerySummaryEntry.setInt(1, variation_id);
- fQuerySummaryEntry.setInt(2, scenario_id);
- fQuerySummaryEntry.setInt(3, dim_id);
- fQuerySummaryEntry.setShort(4, (short) (isGlobal ? 1 : 0));
- fQuerySummaryEntry.setInt(5, comment_id);
- ResultSet result= fQuerySummaryEntry.executeQuery();
- if (result.next() && result.getInt(1) > 0)
- return;
-
- if (fInsertSummaryEntry == null)
- fInsertSummaryEntry= fConnection.prepareStatement("insert into SUMMARYENTRY (VARIATION_ID, SCENARIO_ID, DIM_ID, IS_GLOBAL, COMMENT_ID) values (?, ?, ?, ?, ?)"); //$NON-NLS-1$
- fInsertSummaryEntry.setInt(1, variation_id);
- fInsertSummaryEntry.setInt(2, scenario_id);
- fInsertSummaryEntry.setInt(3, dim_id);
- fInsertSummaryEntry.setShort(4, (short) (isGlobal ? 1 : 0));
- fInsertSummaryEntry.setInt(5, comment_id);
- fInsertSummaryEntry.executeUpdate();
- }
-
- public void setScenarioShortName(int scenario_id, String shortName) throws SQLException {
- if (shortName.length() >= 40)
- shortName= shortName.substring(0, 40);
- if (fUpdateScenarioShortName == null)
- fUpdateScenarioShortName= fConnection.prepareStatement("update SCENARIO set SHORT_NAME = ? where SCENARIO.ID = ?"); //$NON-NLS-1$
- fUpdateScenarioShortName.setString(1, shortName);
- fUpdateScenarioShortName.setInt(2, scenario_id);
- fUpdateScenarioShortName.executeUpdate();
- }
-
- ResultSet queryGlobalSummaryEntries(Variations variations) throws SQLException {
- if (fQueryGlobalSummaryEntries == null)
- fQueryGlobalSummaryEntries= fConnection.prepareStatement(
- "select distinct SCENARIO.NAME, SCENARIO.SHORT_NAME, SUMMARYENTRY.DIM_ID, SUMMARYENTRY.IS_GLOBAL, SUMMARYENTRY.COMMENT_ID " + //$NON-NLS-1$
- "from VARIATION, SCENARIO, SUMMARYENTRY " + //$NON-NLS-1$
- "where SUMMARYENTRY.VARIATION_ID = VARIATION.ID " + //$NON-NLS-1$
- "and VARIATION.KEYVALPAIRS LIKE ? " + //$NON-NLS-1$
- "and SUMMARYENTRY.SCENARIO_ID = SCENARIO.ID " + //$NON-NLS-1$
- "and SUMMARYENTRY.IS_GLOBAL = 1 " + //$NON-NLS-1$
- "order by SCENARIO.NAME" //$NON-NLS-1$
- );
- fQueryGlobalSummaryEntries.setString(1, variations.toExactMatchString());
- return fQueryGlobalSummaryEntries.executeQuery();
- }
-
- ResultSet querySummaryEntries(Variations variations, String scenarioPattern) throws SQLException {
- if (fQuerySummaryEntries == null)
- fQuerySummaryEntries= fConnection.prepareStatement(
- "select distinct SCENARIO.NAME, SCENARIO.SHORT_NAME, SUMMARYENTRY.DIM_ID, SUMMARYENTRY.IS_GLOBAL, SUMMARYENTRY.COMMENT_ID " + //$NON-NLS-1$
- "from VARIATION, SCENARIO, SUMMARYENTRY " + //$NON-NLS-1$
- "where SUMMARYENTRY.VARIATION_ID = VARIATION.ID " + //$NON-NLS-1$
- "and VARIATION.KEYVALPAIRS LIKE ? " + //$NON-NLS-1$
- "and SUMMARYENTRY.SCENARIO_ID = SCENARIO.ID " + //$NON-NLS-1$
- "and SCENARIO.NAME like ? " + //$NON-NLS-1$
- "order by SCENARIO.NAME" //$NON-NLS-1$
- );
- fQuerySummaryEntries.setString(1, variations.toExactMatchString());
- fQuerySummaryEntries.setString(2, scenarioPattern);
- return fQuerySummaryEntries.executeQuery();
- }
-
- void insertFailure(int variation_id, int scenario_id, String message) throws SQLException {
- if (fInsertFailure == null)
- fInsertFailure= fConnection.prepareStatement("insert into FAILURE values (?, ?, ?)"); //$NON-NLS-1$
- fInsertFailure.setInt(1, variation_id);
- fInsertFailure.setInt(2, scenario_id);
- fInsertFailure.setString(3, message);
- fInsertFailure.executeUpdate();
- }
-
- public ResultSet queryFailure(Variations variations, String scenarioPattern) throws SQLException {
- if (fQueryFailure == null)
- fQueryFailure= fConnection.prepareStatement("select SCENARIO.NAME, FAILURE.MESSAGE from FAILURE, VARIATION, SCENARIO where " + //$NON-NLS-1$
- "FAILURE.VARIATION_ID = VARIATION.ID and VARIATION.KEYVALPAIRS LIKE ? and " + //$NON-NLS-1$
- "FAILURE.SCENARIO_ID = SCENARIO.ID and SCENARIO.NAME LIKE ?" //$NON-NLS-1$
- );
- fQueryFailure.setString(1, variations.toExactMatchString());
- fQueryFailure.setString(2, scenarioPattern);
- return fQueryFailure.executeQuery();
- }
-
- int getCommentId(int commentKind, String comment) throws SQLException {
- if (comment.length() > 400)
- comment= comment.substring(0, 400);
- if (fQueryComment == null)
- fQueryComment= fConnection.prepareStatement("select ID from COMMENT where KIND = ? and TEXT = ?"); //$NON-NLS-1$
- fQueryComment.setInt(1, commentKind);
- fQueryComment.setString(2, comment);
- ResultSet result= fQueryComment.executeQuery();
- while (result.next())
- return result.getInt(1);
-
- if (fInsertComment == null)
- fInsertComment= fConnection.prepareStatement("insert into COMMENT (KIND, TEXT) values (?, ?)", Statement.RETURN_GENERATED_KEYS); //$NON-NLS-1$
- fInsertComment.setInt(1, commentKind);
- fInsertComment.setString(2, comment);
- return create(fInsertComment);
- }
-
- public ResultSet getComment(int comment_id) throws SQLException {
- if (fQueryComment2 == null)
- fQueryComment2= fConnection.prepareStatement("select KIND, TEXT from COMMENT where ID = ?"); //$NON-NLS-1$
- fQueryComment2.setInt(1, comment_id);
- return fQueryComment2.executeQuery();
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Scenario.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Scenario.java
deleted file mode 100755
index a5ec83e3f..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Scenario.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import junit.framework.Assert;
-
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.eval.StatisticsSession;
-
-/**
- * A Scenario contains a series of data points for a single scenario.
- * The axis of the data points can be specified when creating a scenario.
- * Typical examples are:
- * - datapoints corresponding to different builds
- * - datapoints corresponding to different OSes
- * - datapoints corresponding to different JVMs
- * @since 3.1
- */
-public class Scenario {
-
- private final static boolean DEBUG= false;
-
- public static class SharedState {
-
- private Variations fVariations;
- private String fSeriesKey;
- private Set fQueryDimensions;
- private String fScenarioPattern;
- private Map fMessages;
-
-
- SharedState(Variations variations, String scenarioPattern, String seriesKey, Dim[] dimensions) {
- fVariations= variations;
- fScenarioPattern= scenarioPattern;
- fSeriesKey= seriesKey;
- if (dimensions != null && dimensions.length > 0) {
- fQueryDimensions= new HashSet();
- for (int i= 0; i < dimensions.length; i++)
- fQueryDimensions.add(dimensions[i]);
- }
- }
-
- String[] getFailures(String[] names, String scenarioId) {
- if (fMessages == null) {
- fMessages= new HashMap();
- Variations v= (Variations) fVariations.clone();
- for (int i= 0; i < names.length; i++) {
- v.put(fSeriesKey, names[i]);
- Map map= DB.queryFailure(fScenarioPattern, v);
- fMessages.put(names[i], map);
- }
- }
- String[] result= new String[names.length];
- for (int i= 0; i < names.length; i++) {
- Map messages= (Map) fMessages.get(names[i]);
- if (messages != null)
- result[i]= (String) messages.get(scenarioId);
- }
- return result;
- }
- }
-
- private SharedState fSharedState;
- private String fScenarioName;
- private String[] fSeriesNames;
- private StatisticsSession[] fSessions;
- private Map fSeries= new HashMap();
- private Dim[] fDimensions;
-
- /**
- * @param scenario
- * @param variations
- * @param seriesKey
- * @param dimensions
- * @deprecated
- */
- public Scenario(String scenario, Variations variations, String seriesKey, Dim[] dimensions) {
- Assert.assertFalse(scenario.indexOf('%') >= 0);
- fScenarioName= scenario;
- fSharedState= new SharedState(variations, scenario, seriesKey, dimensions);
- }
-
- /**
- * @param scenario
- * @param sharedState
- */
- public Scenario(String scenario, SharedState sharedState) {
- Assert.assertFalse(scenario.indexOf('%') >= 0);
- fScenarioName= scenario;
- fSharedState= sharedState;
- }
-
- public String getScenarioName() {
- return fScenarioName;
- }
-
- public Dim[] getDimensions() {
- loadSessions();
- if (fDimensions == null)
- return new Dim[0];
- return fDimensions;
- }
-
- public String[] getTimeSeriesLabels() {
- loadSeriesNames();
- if (fSeriesNames == null)
- return new String[0];
- return fSeriesNames;
- }
-
- public String[] getFailureMessages() {
- loadSeriesNames();
- return fSharedState.getFailures(fSeriesNames, fScenarioName);
- }
-
- public TimeSeries getTimeSeries(Dim dim) {
- loadSessions();
- TimeSeries ts= (TimeSeries) fSeries.get(dim);
- if (ts == null) {
- double[] ds= new double[fSessions.length];
- double[] sd= new double[fSessions.length];
- long[] sizes= new long[fSessions.length];
- for (int i= 0; i < ds.length; i++) {
- ds[i]= fSessions[i].getAverage(dim);
- sd[i]= fSessions[i].getStddev(dim);
- sizes[i]= fSessions[i].getCount(dim);
- }
- ts= new TimeSeries(fSeriesNames, ds, sd, sizes);
- fSeries.put(dim, ts);
- }
- return ts;
- }
-
- public void dump(PrintStream ps, String key) {
- ps.println("Scenario: " + getScenarioName()); //$NON-NLS-1$
- Report r= new Report(2);
-
- String[] timeSeriesLabels= getTimeSeriesLabels();
- r.addCell(key + ":"); //$NON-NLS-1$
- for (int j= 0; j < timeSeriesLabels.length; j++)
- r.addCellRight(timeSeriesLabels[j]);
- r.nextRow();
-
- Dim[] dimensions= getDimensions();
- for (int i= 0; i < dimensions.length; i++) {
- Dim dim= dimensions[i];
- r.addCell(dim.getName() + ':');
-
- TimeSeries ts= getTimeSeries(dim);
- int n= ts.getLength();
- for (int j= 0; j < n; j++) {
- String stddev= ""; //$NON-NLS-1$
- double stddev2= ts.getStddev(j);
- if (stddev2 != 0.0)
- stddev= " [" + dim.getDisplayValue(stddev2) + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- r.addCellRight(dim.getDisplayValue(ts.getValue(j)) + stddev);
- }
- r.nextRow();
- }
- r.print(ps);
- ps.println();
- }
-
- //---- private
-
- private void loadSeriesNames() {
- if (fSeriesNames == null) {
- long start;
- if (DEBUG) start= System.currentTimeMillis();
- fSeriesNames= DB.querySeriesValues(fScenarioName, fSharedState.fVariations, fSharedState.fSeriesKey);
- if (DEBUG) System.err.println("names: " + (System.currentTimeMillis()-start)); //$NON-NLS-1$
- }
- }
-
- private void loadSessions() {
- if (fSessions != null)
- return;
-
- loadSeriesNames();
-
- long start;
- Variations v= (Variations) fSharedState.fVariations.clone();
- if (DEBUG) start= System.currentTimeMillis();
- ArrayList sessions= new ArrayList();
- ArrayList names2= new ArrayList();
- Set dims= new HashSet();
- for (int t= 0; t < fSeriesNames.length; t++) {
- v.put(fSharedState.fSeriesKey, fSeriesNames[t]);
- DataPoint[] dps= DB.queryDataPoints(v, fScenarioName, fSharedState.fQueryDimensions);
- if (DEBUG) System.err.println(" dps length: " + dps.length); //$NON-NLS-1$
- if (dps.length > 0) {
- dims.addAll(dps[0].getDimensions2());
- sessions.add(new StatisticsSession(dps));
- names2.add(fSeriesNames[t]);
- }
- }
- if (DEBUG) System.err.println("data: " + (System.currentTimeMillis()-start)); //$NON-NLS-1$
-
- fSessions= (StatisticsSession[]) sessions.toArray(new StatisticsSession[sessions.size()]);
- fSeriesNames= (String[]) names2.toArray(new String[sessions.size()]);
-
- fDimensions= (Dim[]) dims.toArray(new Dim[dims.size()]);
- Arrays.sort(fDimensions,
- new Comparator() {
- public int compare(Object o1, Object o2) {
- Dim d1= (Dim)o1;
- Dim d2= (Dim)o2;
- return d1.getName().compareTo(d2.getName());
- }
- }
- );
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SummaryEntry.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SummaryEntry.java
deleted file mode 100755
index 3a19e77c4..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/SummaryEntry.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import org.eclipse.test.internal.performance.data.Dim;
-
-
-public class SummaryEntry {
- public String scenarioName;
- public String shortName;
- public Dim dimension;
- public boolean isGlobal;
- public int commentKind;
- public String comment;
-
- SummaryEntry(String scenarioName, String shortName, Dim dimension, boolean isGlobal) {
- this.scenarioName= scenarioName;
- this.shortName= shortName;
- this.dimension= dimension;
- this.isGlobal= isGlobal;
- }
-
- SummaryEntry(String scenarioName, String shortName, Dim dimension, boolean isGlobal, int commentKind, String comment) {
- this.scenarioName= scenarioName;
- this.shortName= shortName;
- this.dimension= dimension;
- this.isGlobal= isGlobal;
- this.commentKind= commentKind;
- this.comment= comment;
- }
-
- public String toString() {
- return "SummaryEntry("+isGlobal+"): <" + scenarioName + "> <" + shortName + "> <" + dimension + '>'; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/TimeSeries.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/TimeSeries.java
deleted file mode 100755
index 310890865..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/TimeSeries.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-public class TimeSeries {
-
- private String[] fBuildNames;
- private double[] fAverages;
- private double[] fStddev;
- private long[] fCount;
-
- TimeSeries(String[] tags, double[] averages, double[] stddev, long[] sizes) {
- fBuildNames= tags;
- fAverages= averages;
- fStddev= stddev;
- fCount= sizes;
- }
-
- /**
- * Returns length of series.
- * @return length of series
- */
- public int getLength() {
- return fBuildNames.length;
- }
-
- /**
- * Returns value at given index.
- * @param ix
- * @return value at given index
- */
- public double getValue(int ix) {
- return fAverages[ix];
- }
-
- /**
- * Returns std dev at given index.
- * @param ix
- * @return std dev at given index
- */
- public double getStddev(int ix) {
- return fStddev[ix];
- }
-
- /**
- * Returns label at given index.
- * @param ix
- * @return label at given index
- */
- public String getLabel(int ix) {
- return fBuildNames[ix];
- }
-
- /**
- * Returns the sample size at the given index.
- *
- * @param ix
- * @return the sample size at the given index
- */
- public long getCount(int ix) {
- return fCount[ix];
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Variations.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Variations.java
deleted file mode 100755
index 751a6c642..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/Variations.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import java.util.Arrays;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-
-/**
- * The <code>Variations</code> class represents a set of key/value pairs
- * and is used to tag data stored in the performance database and when
- * querying for data from the database.
- */
-public class Variations extends Properties {
-
- private static final long serialVersionUID= 1L;
-
- /**
- * Creates an empty set of key/value pairs.
- */
- public Variations() {
- //
- }
-
- /**
- * Creates a Variations object that is populated with a "config" and a "build" key/value pair.
- * @param configValue a value to store under the config key
- * @param buildValue a value to store under the build key
- * @deprecated Use the default constructor instead and fill in key/value pairs explicitely.
- */
- public Variations(String configValue, String buildValue) {
- if (configValue != null)
- put(PerformanceTestPlugin.CONFIG, configValue);
- if (buildValue != null)
- put(PerformanceTestPlugin.BUILD, buildValue);
- }
-
- /**
- * Creates a set of key/value pairs by parsing the given string.
- * The format of the string must be:
- * <pre>
- * key1=value1;key2=value2; .... ; keyn=valuen
- * </pre>
- * @param keyValuePairs
- */
- public Variations(String keyValuePairs) {
- parsePairs(keyValuePairs);
- }
-
- public String toExactMatchString() {
- return toDB(this, false);
- }
-
- public String toQueryPattern() {
- return toDB(this, true);
- }
-
- public void parsePairs(String keyvaluepairs) {
- parse(keyvaluepairs, ";"); //$NON-NLS-1$
- }
-
- public void parseDB(String keyvaluepairs) {
- parse(keyvaluepairs, "|"); //$NON-NLS-1$
- }
-
- /**
- * parsing the given string as key/value pairs and stores them in Variations.
- * The string's format is an implementation detail of the database.
- * @param keyvaluepairs
- * @param separator
- */
- private void parse(String keyvaluepairs, String separator) {
- StringTokenizer st= new StringTokenizer(keyvaluepairs, separator);
- while (st.hasMoreTokens()) {
- String token= st.nextToken();
- int i= token.indexOf('=');
- if (i < 1)
- throw new IllegalArgumentException("kev/value pair '" + token + "' is illformed"); //$NON-NLS-1$ //$NON-NLS-2$
- String value= token.substring(i+1);
- token= token.substring(0, i);
- //System.out.println(token + ": <" + value + ">");
- put(token, value);
- }
- }
-
- /*
- * TODO: we need to escape '=' and ';' characters in key/values.
- */
- private static String toDB(Properties keyValues, boolean asQuery) {
- Set set= keyValues.keySet();
- String[] keys= (String[]) set.toArray(new String[set.size()]);
- Arrays.sort(keys);
- StringBuffer sb= new StringBuffer();
-
- for (int i= 0; i < keys.length; i++) {
- if (asQuery)
- sb.append('%');
- String key= keys[i];
- String value= keyValues.getProperty(key);
- sb.append('|');
- sb.append(key);
- sb.append('=');
- if (value != null)
- sb.append(value);
- sb.append('|');
- }
- if (asQuery)
- sb.append('%');
- return sb.toString();
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/View.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/View.java
deleted file mode 100755
index 677ae2ecd..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/db/View.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.db;
-
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-
-/**
- * Dumps performance data to stdout.
- */
-public class View {
-
- public static void main(String[] args) {
-
- Variations variations= PerformanceTestPlugin.getVariations();
- variations.put("config", "eclipseperfwin2_R3.3"); //$NON-NLS-1$//$NON-NLS-2$
- variations.put("build", "I200704%"); //$NON-NLS-1$//$NON-NLS-2$
- variations.put("jvm", "sun"); //$NON-NLS-1$//$NON-NLS-2$
-
- String scenarioPattern= "%RevertJavaEditorTest%"; //$NON-NLS-1$
-
- String seriesKey= PerformanceTestPlugin.BUILD;
-
- Scenario[] scenarios= DB.queryScenarios(variations, scenarioPattern, seriesKey, null);
- System.out.println(scenarios.length + " Scenarios"); //$NON-NLS-1$
- System.out.println();
-
- for (int s= 0; s < scenarios.length; s++)
- scenarios[s].dump(System.out, PerformanceTestPlugin.BUILD);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AbsoluteBandChecker.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AbsoluteBandChecker.java
deleted file mode 100755
index b552010fc..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AbsoluteBandChecker.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Scalar;
-
-
-/**
- * @since 3.1
- */
-public class AbsoluteBandChecker extends AssertChecker {
-
- private long fLowerBand;
- private long fUpperBand;
-
- public AbsoluteBandChecker(Dim dimension, long lowerBand, long upperBand) {
- super(dimension);
- fLowerBand= lowerBand;
- fUpperBand= upperBand;
- }
-
- public boolean test(StatisticsSession reference, StatisticsSession measured, StringBuffer message) {
- Dim dimension= getDimension();
-
- if (!measured.contains(dimension)) {
- PerformanceTestPlugin.logWarning("collected data provides no dimension '"+dimension.getName()+'\''); //$NON-NLS-1$
- return true;
- }
- if (!reference.contains(dimension)) {
- PerformanceTestPlugin.logWarning("reference data provides no dimension '"+dimension.getName()+'\''); //$NON-NLS-1$
- return true;
- }
-
- double actual= measured.getAverage(dimension);
- double test= reference.getAverage(dimension);
-
- if (actual > fUpperBand + test || actual < test - fLowerBand) {
- message.append('\n' + dimension.getName() + ": " + dimension.getDisplayValue(actual) + " is not within [-" + dimension.getDisplayValue(new Scalar(null, fLowerBand)) + ", +" + dimension.getDisplayValue(new Scalar(null, fUpperBand)) + "] of " + dimension.getDisplayValue(test)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return false;
- }
-
- return true;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AssertChecker.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AssertChecker.java
deleted file mode 100755
index dc6339bbb..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/AssertChecker.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.test.internal.performance.data.Assert;
-import org.eclipse.test.internal.performance.data.Dim;
-
-/**
- * @since 3.1
- */
-public abstract class AssertChecker {
- private Set fDimensions;
-
- public AssertChecker(Dim dimension) {
- this(new Dim[] {dimension});
- }
-
- public AssertChecker(Dim[] dimensions) {
- fDimensions= new HashSet();
- fDimensions.addAll(Arrays.asList(dimensions));
- }
-
- public Dim[] getDimensions() {
- return (Dim[]) fDimensions.toArray(new Dim[fDimensions.size()]);
- }
-
- protected Dim getDimension() {
- Assert.isTrue(fDimensions.size() == 1);
- return getDimensions()[0];
- }
-
- /**
- * Evaluates the predicate.
- *
- * @param reference statistics of dimensions of the reference metering session
- * @param measured statistics of dimensions of the metering session to be tested
- * @param message a message presented to the user upon failure
- * @return <code>true</code> if the predicate passes, <code>false</code> if it fails
- */
- public abstract boolean test(StatisticsSession reference, StatisticsSession measured, StringBuffer message);
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Entries
deleted file mode 100644
index 3268d4362..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Entries
+++ /dev/null
@@ -1,9 +0,0 @@
-/AbsoluteBandChecker.java/1.8/Mon Feb 20 15:39:47 2006//Tv20101027
-/AssertChecker.java/1.5/Mon Feb 20 15:39:47 2006//Tv20101027
-/EmptyEvaluator.java/1.4/Mon Feb 20 15:39:47 2006//Tv20101027
-/Evaluator.java/1.25/Mon Feb 20 15:39:47 2006//Tv20101027
-/IEvaluator.java/1.3/Mon Feb 20 15:39:47 2006//Tv20101027
-/RelativeBandChecker.java/1.10/Mon Feb 20 15:39:47 2006//Tv20101027
-/StatisticsSession.java/1.17/Wed Apr 25 13:55:08 2007//Tv20101027
-/StatisticsUtil.java/1.3/Tue May 15 19:23:19 2007/-kk/Tv20101027
-D
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Repository
deleted file mode 100644
index 1bcfc6ecb..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/EmptyEvaluator.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/EmptyEvaluator.java
deleted file mode 100755
index 72b96579e..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/EmptyEvaluator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance.eval;
-
-import org.eclipse.test.performance.PerformanceMeter;
-
-/**
- * The empty evaluator. Does nothing.
- */
-public class EmptyEvaluator implements IEvaluator {
-
- /*
- * @see org.eclipse.test.internal.performance.eval.IEvaluator#evaluate(org.eclipse.jdt.ui.tests.performance.PerformanceMeter)
- */
- public void evaluate(PerformanceMeter performanceMeter) throws RuntimeException {
- // empty
- }
-
- /*
- * @see org.eclipse.test.internal.performance.eval.IEvaluator#setAssertCheckers(org.eclipse.test.internal.performance.eval.AssertChecker[])
- */
- public void setAssertCheckers(AssertChecker[] asserts) {
- // empty
- }
-
- /*
- * @see org.eclipse.test.internal.performance.eval.IEvaluator#setReferenceFilterProperties(java.lang.String, java.lang.String)
- */
- public void setReferenceFilterProperties(String driver, String timestamp) {
- // empty
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/Evaluator.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/Evaluator.java
deleted file mode 100755
index ea4b61635..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/Evaluator.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import java.util.HashSet;
-import junit.framework.Assert;
-
-import org.eclipse.test.internal.performance.InternalPerformanceMeter;
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Sample;
-import org.eclipse.test.internal.performance.db.DB;
-import org.eclipse.test.internal.performance.db.Variations;
-import org.eclipse.test.performance.PerformanceMeter;
-
-/**
- * The default implementation of an evaluator backed by a database.
- * @since 3.1
- */
-public class Evaluator extends EmptyEvaluator {
-
- private AssertChecker[] fCheckers;
-
-
- public void setAssertCheckers(AssertChecker[] asserts) {
- fCheckers= asserts;
- }
-
- /*
- * @see org.eclipse.test.internal.performance.eval.IEvaluator#evaluate(org.eclipse.jdt.ui.tests.performance.PerformanceMeter)
- */
- public void evaluate(PerformanceMeter performanceMeter) throws RuntimeException {
-
- if (fCheckers == null)
- return; // nothing to do
-
- // get reference build tag
- Variations refKeys= PerformanceTestPlugin.getAssertAgainst();
- if (refKeys == null)
- return; // nothing to do
-
- if (!(performanceMeter instanceof InternalPerformanceMeter))
- return; // we cannot handle this.
-
- InternalPerformanceMeter ipm= (InternalPerformanceMeter) performanceMeter;
- Sample session= ipm.getSample();
- Assert.assertTrue("metering session is null", session != null); //$NON-NLS-1$
- String scenarioName= session.getScenarioID();
-
- // determine all dimensions we need
- HashSet allDimensions= new HashSet();
- for (int i= 0; i < fCheckers.length; i++) {
- AssertChecker chk= fCheckers[i];
- Dim[] dims= chk.getDimensions();
- for (int j= 0; j < dims.length; j++)
- allDimensions.add(dims[j]);
- }
-
- // get data for this session
- DataPoint[] sessionDatapoints;
- Variations config= PerformanceTestPlugin.getVariations();
- if (config != null)
- sessionDatapoints= DB.queryDataPoints(config, scenarioName, allDimensions);
- else
- sessionDatapoints= session.getDataPoints();
- if (sessionDatapoints == null || sessionDatapoints.length == 0) {
- PerformanceTestPlugin.logWarning("no session data named '" + config + "' found"); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
-
- // get reference data
- DataPoint[] datapoints= DB.queryDataPoints(refKeys, scenarioName, allDimensions);
- if (datapoints == null || datapoints.length == 0) {
- PerformanceTestPlugin.logWarning("no reference data named '" + refKeys + "' found"); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
-
- // calculate the average
- StatisticsSession referenceStats= new StatisticsSession(datapoints);
- StatisticsSession measuredStats= new StatisticsSession(sessionDatapoints);
-
- StringBuffer failMesg= new StringBuffer("Performance criteria not met when compared to '" + refKeys + "':"); //$NON-NLS-1$ //$NON-NLS-2$
- boolean pass= true;
- for (int i= 0; i < fCheckers.length; i++) {
- AssertChecker chk= fCheckers[i];
- pass &= chk.test(referenceStats, measuredStats, failMesg);
- }
-
- if (!pass) {
- if (config != null)
- DB.markAsFailed(config, session, failMesg.toString());
-// else
-// Assert.assertTrue(failMesg.toString(), false);
- }
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/IEvaluator.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/IEvaluator.java
deleted file mode 100755
index a237388df..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/IEvaluator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import org.eclipse.test.performance.PerformanceMeter;
-
-/**
- * @since 3.1
- */
-public interface IEvaluator {
-
- /**
- * Evaluates the given performance meter by comparing its measurements
- * against the reference data selected with
- * <code>setReferenceFilterProperties</code>.
- *
- * @param performanceMeter the performance meter
- * @throws RuntimeException when the comparison does not pass
- */
- void evaluate(PerformanceMeter performanceMeter) throws RuntimeException;
-
- /**
- * Sets the asserts that should be evaluated by the evaluator.
- *
- * @param asserts the assert checkers that should be evaluated by the evaluator
- */
- void setAssertCheckers(AssertChecker[] asserts);
-
- /**
- * Selects the reference build against which the current session will
- * be compared in <code>evaluate</code>.
- * @param driver
- * @param timestamp the timestamp of the reference, may be null to use any
- */
- void setReferenceFilterProperties(String driver, String timestamp);
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/RelativeBandChecker.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/RelativeBandChecker.java
deleted file mode 100755
index 22856d470..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/RelativeBandChecker.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.Dim;
-
-/**
- * @since 3.1
- */
-public class RelativeBandChecker extends AssertChecker {
-
- private final double fLowerBand;
- private final double fUpperBand;
-
- public RelativeBandChecker(Dim dimension, double lowerBand, double upperBand) {
- super(dimension);
- fLowerBand= lowerBand;
- fUpperBand= upperBand;
- }
-
- public boolean test(StatisticsSession reference, StatisticsSession measured, StringBuffer message) {
- Dim dimension= getDimension();
-
- if (!measured.contains(dimension)) {
- PerformanceTestPlugin.logWarning("collected data provides no dimension '"+dimension.getName()+'\''); //$NON-NLS-1$
- return true;
- }
- if (!reference.contains(dimension)) {
- PerformanceTestPlugin.logWarning("reference data provides no dimension '"+dimension.getName()+'\''); //$NON-NLS-1$
- return true;
- }
-
- double actual= measured.getAverage(dimension);
- double test= reference.getAverage(dimension);
-
- if (test < 0.001 && test > -0.001) {
- // we don't fail for reference value of zero
- PerformanceTestPlugin.logWarning("ref value for '"+dimension.getName()+"' is too small"); //$NON-NLS-1$ //$NON-NLS-2$
- return true;
- }
- if (actual < 0) {
- // we don't fail for negative values
- PerformanceTestPlugin.logWarning("actual value for '"+dimension.getName()+"' is negative"); //$NON-NLS-1$ //$NON-NLS-2$
- return true;
- }
-
- if (actual > fUpperBand * test || actual < fLowerBand * test) {
- message.append('\n' + dimension.getName() + ": " + dimension.getDisplayValue(actual) + " is not within [" + Math.round(fLowerBand * 100)+ "%, " + Math.round(fUpperBand * 100) + "%] of " + dimension.getDisplayValue(test)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return false;
- }
- return true;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsSession.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsSession.java
deleted file mode 100755
index 799bddd29..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsSession.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.test.internal.performance.InternalPerformanceMeter;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Scalar;
-import org.eclipse.test.internal.performance.eval.StatisticsUtil.Percentile;
-
-import junit.framework.Assert;
-
-/**
- * @since 3.1
- */
-public class StatisticsSession {
-
- static final class Statistics {
- public long count;
- public long sum;
- public double average;
- public double stddev;
- }
-
- private final DataPoint[] fDataPoints;
- private final Map fStatistics= new HashMap();
-
- public StatisticsSession(DataPoint[] datapoints) {
- fDataPoints= datapoints;
- }
-
- public double getAverage(Dim dimension) {
- return getStats(dimension).average;
- }
-
- public long getSum(Dim dimension) {
- return getStats(dimension).sum;
- }
-
- public long getCount(Dim dimension) {
- return getStats(dimension).count;
- }
-
- public double getStddev(Dim dimension) {
- return getStats(dimension).stddev;
- }
-
- double getStderr_mean(Dim dimension) {
- return getStats(dimension).stddev / Math.sqrt(getStats(dimension).count);
- }
-
- double getStudentsT(Dim dimension, Percentile percentile) {
- int df= (int) getStats(dimension).count - 1;
- return StatisticsUtil.getStudentsT(df, percentile);
- }
-
- /**
- * Returns the confidence interval for the given dimension and the percentile.
- *
- * @param dimension the dimension
- * @param percentile the percentile
- * @return an array of length two, with the lower and upper bounds of the confidence interval
- */
- public double[] getConfidenceInterval(Dim dimension, Percentile percentile) {
- double mean= getAverage(dimension);
- double stat_err= getStderr_mean(dimension);
-
- double t= getStudentsT(dimension, percentile);
-
- double[] interval= {mean - t * stat_err, mean + t * stat_err};
-
- return interval;
- }
-
- private Statistics getStats(Dim dimension) {
- Statistics stats= (Statistics) fStatistics.get(dimension);
- if (stats == null) {
- stats= computeStats(dimension);
- fStatistics.put(dimension, stats);
- }
- return stats;
- }
-
- private Statistics computeStats(Dim dimension) {
-
- Statistics stats;
-
- Set steps= new HashSet();
- for (int j= 0; j < fDataPoints.length; j++) {
- DataPoint dp= fDataPoints[j];
- steps.add(new Integer(dp.getStep()));
- }
-
- if (steps.contains(new Integer(InternalPerformanceMeter.AVERAGE))) {
- // an already aggregated set of data points from the DB
- stats= computeStatsFromAggregates(dimension);
- } else if (steps.contains(new Integer(InternalPerformanceMeter.AFTER))) {
- // raw values from measurement
- stats= computeStatsFromMeasurements(dimension, steps);
- } else {
- Assert.fail("illegal data set: contains neither AVERAGE nor AFTER values."); //$NON-NLS-1$
- stats= null; // dummy
- }
-
- return stats;
- }
-
- private Statistics computeStatsFromAggregates(Dim dimension) {
- Statistics stats= new Statistics();
- long aggregateCount= 0;
- double averageSum= 0;
- long countSum= 0;
- double stdevSum= 0;
-
-// Set acquiredAggregates= new HashSet();
- for (int i= 0; i < fDataPoints.length; i++) {
- DataPoint point= fDataPoints[i];
- Scalar scalar= point.getScalar(dimension);
- if (scalar == null)
- continue;
-
- Integer aggregate= new Integer(point.getStep());
- // allow for multiple measurements that were each stored with their own
- // aggregate values
-// Assert.assertTrue(acquiredAggregates.add(aggregate));
-
- long magnitude= scalar.getMagnitude();
- switch (aggregate.intValue()) {
- case InternalPerformanceMeter.AVERAGE:
- averageSum += magnitude;
- aggregateCount++;
- break;
- case InternalPerformanceMeter.STDEV:
- // see DB.internalStore
- stdevSum += Double.longBitsToDouble(magnitude);
- break;
- case InternalPerformanceMeter.SIZE:
- countSum += magnitude;
- break;
- default:
- Assert.fail("only average, stdev and size are supported in aggregate mode"); //$NON-NLS-1$
- break;
- }
- }
-
- stats.average= averageSum / aggregateCount;
- stats.stddev= stdevSum / aggregateCount; // XXX this does not work! have to treat multiple runs like normal measurement data
- stats.count= countSum;
- stats.sum= Math.round(stats.count * stats.average);
-
- return stats;
- }
-
- private Statistics computeStatsFromMeasurements(Dim dimension, Set steps) {
- Statistics stats= new Statistics();
- long mags[];
- switch (steps.size()) {
- case 1:
- // if there is only one Step, we don't calculate the delta. happens for startup tests
- mags= new long[fDataPoints.length];
- for (int i= 0; i < fDataPoints.length; i++) {
- Scalar sc= fDataPoints[i].getScalar(dimension);
- mags[i]= sc == null ? 0 : sc.getMagnitude();
- }
- break;
- case 2:
- int count= fDataPoints.length / 2;
- mags= new long[count];
- for (int i= 0; i < count; i ++) {
- DataPoint before= fDataPoints[2 * i];
- Assert.assertTrue("wrong order of steps", before.getStep() == InternalPerformanceMeter.BEFORE); //$NON-NLS-1$
- DataPoint after= fDataPoints[2 * i + 1];
- Assert.assertTrue("wrong order of steps", after.getStep() == InternalPerformanceMeter.AFTER); //$NON-NLS-1$
-
- Scalar delta= getDelta(before, after, dimension);
- long magnitude= delta.getMagnitude();
- mags[i]= magnitude;
- }
- break;
- default:
- Assert.fail("cannot handle more than two steps in measurement mode"); //$NON-NLS-1$
- return null; // dummy
- }
-
- for (int i= 0; i < mags.length; i++) {
- stats.sum += mags[i];
- stats.count++;
- }
-
- if (stats.count > 0) {
- stats.average= (double) stats.sum / stats.count;
- if (stats.count == 1) {
- stats.stddev= 0;
- } else {
- double squaredDeviations= 0;
- for (int i= 0; i < mags.length; i++) {
- double deviation= stats.average - mags[i];
- squaredDeviations += deviation * deviation;
- }
- stats.stddev= Math.sqrt(squaredDeviations / (stats.count - 1)); // unbiased sample stdev
- }
- } else {
- stats.average= 0;
- stats.stddev= 0;
- }
-
- return stats;
- }
-
- private Scalar getDelta(DataPoint before, DataPoint after, Dim dimension) {
- Scalar one= before.getScalar(dimension);
- Assert.assertTrue("reference has no value for dimension " + dimension, one != null); //$NON-NLS-1$
-
- Scalar two= after.getScalar(dimension);
- Assert.assertTrue("reference has no value for dimension " + dimension, two != null); //$NON-NLS-1$
-
- return new Scalar(one.getDimension(), two.getMagnitude() - one.getMagnitude());
- }
-
- public boolean contains(Dim dimension) {
- if (fDataPoints.length > 0)
- return fDataPoints[0].contains(dimension);
- return false;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsUtil.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsUtil.java
deleted file mode 100755
index a11412942..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/eval/StatisticsUtil.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.eval;
-
-import org.eclipse.test.internal.performance.db.TimeSeries;
-
-/**
- * Utility methods for statistics.
- *
- * @since 3.2
- */
-public final class StatisticsUtil {
- /**
- * Percentile constants class.
- *
- * @since 3.2
- */
- public static final class Percentile {
- final int fColumn;
- private final double fInside;
-
- private Percentile(int column, double inside) {
- fColumn= column;
- fInside= inside;
- }
-
- /**
- * Returns how much is within the percentile, [0, 1]
- *
- * @return the inside quotient
- */
- public double inside() {
- return fInside;
- }
- }
-
- public static final Percentile T90= new Percentile(0, 0.9);
- public static final Percentile T95= new Percentile(1, 0.95);
- public static final Percentile T97_5= new Percentile(2, 0.975);
- public static final Percentile T99= new Percentile(3, 0.99);
-
- /**
- * Returns the student's t value from the two-tailed t-table. For a degree-of-freedom larger
- * than 100, the value for 100 is returned.
- *
- * @param df the degrees of freedom (usually sample size - 1)
- * @param percentile the percentile
- * @return the corresponding student's t value
- */
- public static double getStudentsT(int df, Percentile percentile) {
- if (df < 0)
- df= 0;
- else if (df > 100)
- df= 100;
- return T[df][percentile.fColumn];
- }
-
- /**
- * Returns <code>true</code> if the mean of two data sets is significantly different, such
- * that the probability that they are from the same population is lower than
- * <code>percentile</code>, <code>false</code> otherwise. The data sets are taken from
- * <code>series</code> at <code>index1</code> and <code>index2</code>.
- * <p>
- * Note that no conclusion must be drawn from a <code>false</code> return value: it does not
- * indicate that the two data sets are from the same population - there may simply be not enough
- * data to conclude the other way, for example due to a small sample size or large standard
- * deviation.
- * </p>
- * <p>
- * Also note that a <code>true</code> return value does not say anything about the relevance
- * of the difference - a statistically significant difference may be practically irrelevant if
- * it is small.
- * </p>
- * <p>
- * XXX the current implementation assumes that the standard deviations are sufficiently similar.
- * </p>
- *
- * @param refSeries the time series containing the first data set
- * @param index1 the index into <code>series1</code> for the first data set
- * @param testSeries the time series containing the second data set
- * @param index2 the index into <code>series2</code> for the second data set
- * @param percentile the percentile level to use
- * @return <code>true</code> if the null hypothesis is rejected on the <code>percentile</code>
- * level, <code>false</code> if it cannot be rejected based on the given data
- */
- public static double[] statisticsForTimeSeries(TimeSeries refSeries, int index1, TimeSeries testSeries, int index2, Percentile percentile) {
- // see http://bmj.bmjjournals.com/collections/statsbk/7.shtml
-
- double[] values = new double[] { refSeries.getValue(index1), testSeries.getValue(index2) };
- long[] counts = new long[] { refSeries.getCount(index1), testSeries.getCount(index2) };
- double[] stddevs = new double[] { refSeries.getStddev(index1), testSeries.getStddev(index2) };
- double ttest = studentTtest(values, stddevs, counts, percentile);
- return new double[] {
- getStudentsT((int) (counts[0] + counts[1] - 2), percentile),
- ttest,
- standardError(values, stddevs, counts),
- deviation(values),
- };
- }
-
- public static double studentTtest(double[] values, double[] stddevs, long[] counts, Percentile percentile) {
-
- double ref = values[0];
- double val= values[1];
-
- double delta= ref - val;
- long df1= counts[0] - 1;
- double sd1= stddevs[0];
- long df2= counts[1];
- double sd2= stddevs[1];
- // TODO if the stdev's are not sufficiently similar, we have to take a different approach
-
- if (!Double.isNaN(sd1) && !Double.isNaN(sd2) && df1 > 0 && df2 > 0) {
- long df= df1 + df2;
- double sp_square= (df1 * sd1 * sd1 + df2 * sd2 * sd2) / df;
-
- double se_diff= Math.sqrt(sp_square * (1.0 / (df1 + 1) + 1.0 / (df2 + 1)));
- return Math.abs(delta / se_diff);
- }
-
- return -1;
- }
-
- public static double deviation(double[] values) {
- return (values[1] - values[0]) / values[0];
- }
-
- public static double standardError(double[] values, double[] stddevs, long[] counts) {
- return Math.sqrt((stddevs[0] * stddevs[0] / counts[0]) + (stddevs[1] * stddevs[1] / counts[1])) / values[0];
- }
-
- /**
- * The (two-tailed) T-table. [degrees_of_freedom][percentile]
- */
- private static final double[][] T= {
- { Double.NaN, Double.NaN, Double.NaN, Double.NaN},
- { Double.NaN, Double.NaN, Double.NaN, Double.NaN},
- {2.92,4.3027,6.2054,9.925},
- {2.3534,3.1824,4.1765,5.8408},
- {2.1318,2.7765,3.4954,4.6041},
- {2.015,2.5706,3.1634,4.0321},
- {1.9432,2.4469,2.9687,3.7074},
- {1.8946,2.3646,2.8412,3.4995},
- {1.8595,2.306,2.7515,3.3554},
- {1.8331,2.2622,2.685,3.2498},
- {1.8125,2.2281,2.6338,3.1693},
- {1.7959,2.201,2.5931,3.1058},
- {1.7823,2.1788,2.56,3.0545},
- {1.7709,2.1604,2.5326,3.0123},
- {1.7613,2.1448,2.5096,2.9768},
- {1.7531,2.1315,2.4899,2.9467},
- {1.7459,2.1199,2.4729,2.9208},
- {1.7396,2.1098,2.4581,2.8982},
- {1.7341,2.1009,2.445,2.8784},
- {1.7291,2.093,2.4334,2.8609},
- {1.7247,2.086,2.4231,2.8453},
- {1.7207,2.0796,2.4138,2.8314},
- {1.7171,2.0739,2.4055,2.8188},
- {1.7139,2.0687,2.3979,2.8073},
- {1.7109,2.0639,2.391,2.797},
- {1.7081,2.0595,2.3846,2.7874},
- {1.7056,2.0555,2.3788,2.7787},
- {1.7033,2.0518,2.3734,2.7707},
- {1.7011,2.0484,2.3685,2.7633},
- {1.6991,2.0452,2.3638,2.7564},
- {1.6973,2.0423,2.3596,2.75},
- {1.6955,2.0395,2.3556,2.744},
- {1.6939,2.0369,2.3518,2.7385},
- {1.6924,2.0345,2.3483,2.7333},
- {1.6909,2.0322,2.3451,2.7284},
- {1.6896,2.0301,2.342,2.7238},
- {1.6883,2.0281,2.3391,2.7195},
- {1.6871,2.0262,2.3363,2.7154},
- {1.686,2.0244,2.3337,2.7116},
- {1.6849,2.0227,2.3313,2.7079},
- {1.6839,2.0211,2.3289,2.7045},
- {1.6829,2.0195,2.3267,2.7012},
- {1.682,2.0181,2.3246,2.6981},
- {1.6811,2.0167,2.3226,2.6951},
- {1.6802,2.0154,2.3207,2.6923},
- {1.6794,2.0141,2.3189,2.6896},
- {1.6787,2.0129,2.3172,2.687},
- {1.6779,2.0117,2.3155,2.6846},
- {1.6772,2.0106,2.3139,2.6822},
- {1.6766,2.0096,2.3124,2.68},
- {1.6759,2.0086,2.3109,2.6778},
- {1.6753,2.0076,2.3095,2.6757},
- {1.6747,2.0066,2.3082,2.6737},
- {1.6741,2.0057,2.3069,2.6718},
- {1.6736,2.0049,2.3056,2.67},
- {1.673,2.004,2.3044,2.6682},
- {1.6725,2.0032,2.3033,2.6665},
- {1.672,2.0025,2.3022,2.6649},
- {1.6716,2.0017,2.3011,2.6633},
- {1.6711,2.001,2.3,2.6618},
- {1.6706,2.0003,2.299,2.6603},
- {1.6702,1.9996,2.2981,2.6589},
- {1.6698,1.999,2.2971,2.6575},
- {1.6694,1.9983,2.2962,2.6561},
- {1.669,1.9977,2.2954,2.6549},
- {1.6686,1.9971,2.2945,2.6536},
- {1.6683,1.9966,2.2937,2.6524},
- {1.6679,1.996,2.2929,2.6512},
- {1.6676,1.9955,2.2921,2.6501},
- {1.6672,1.9949,2.2914,2.649},
- {1.6669,1.9944,2.2906,2.6479},
- {1.6666,1.9939,2.2899,2.6469},
- {1.6663,1.9935,2.2892,2.6458},
- {1.666,1.993,2.2886,2.6449},
- {1.6657,1.9925,2.2879,2.6439},
- {1.6654,1.9921,2.2873,2.643},
- {1.6652,1.9917,2.2867,2.6421},
- {1.6649,1.9913,2.2861,2.6412},
- {1.6646,1.9908,2.2855,2.6403},
- {1.6644,1.9905,2.2849,2.6395},
- {1.6641,1.9901,2.2844,2.6387},
- {1.6639,1.9897,2.2838,2.6379},
- {1.6636,1.9893,2.2833,2.6371},
- {1.6634,1.989,2.2828,2.6364},
- {1.6632,1.9886,2.2823,2.6356},
- {1.663,1.9883,2.2818,2.6349},
- {1.6628,1.9879,2.2813,2.6342},
- {1.6626,1.9876,2.2809,2.6335},
- {1.6624,1.9873,2.2804,2.6329},
- {1.6622,1.987,2.28,2.6322},
- {1.662,1.9867,2.2795,2.6316},
- {1.6618,1.9864,2.2791,2.6309},
- {1.6616,1.9861,2.2787,2.6303},
- {1.6614,1.9858,2.2783,2.6297},
- {1.6612,1.9855,2.2779,2.6291},
- {1.6611,1.9852,2.2775,2.6286},
- {1.6609,1.985,2.2771,2.628},
- {1.6607,1.9847,2.2767,2.6275},
- {1.6606,1.9845,2.2764,2.6269},
- {1.6604,1.9842,2.276,2.6264},
- {1.6602,1.984,2.2757,2.6259},
- };
-
- private StatisticsUtil() {
- // don't instantiate
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/AllTests.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/AllTests.java
deleted file mode 100755
index 18eeb1017..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/AllTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite= new TestSuite("Performance Test plugin tests"); //$NON-NLS-1$
-
- //suite.addTestSuite(SimplePerformanceMeterTest.class);
- suite.addTestSuite(VariationsTests.class);
- suite.addTestSuite(DBTests.class);
- suite.addTestSuite(PerformanceMeterFactoryTest.class);
-
- return suite;
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Entries
deleted file mode 100644
index 98373a5c9..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Entries
+++ /dev/null
@@ -1,7 +0,0 @@
-/AllTests.java/1.4/Mon Feb 20 15:39:47 2006//Tv20101027
-/DBTests.java/1.12/Mon Feb 20 15:39:47 2006//Tv20101027
-/PerformanceMeterFactoryTest.java/1.2/Fri Apr 22 12:04:09 2005//Tv20101027
-/SimplePerformanceMeterTest.java/1.2/Fri Apr 22 12:04:09 2005//Tv20101027
-/TestPerformanceMeter.java/1.8/Mon Feb 20 15:39:47 2006//Tv20101027
-/VariationsTests.java/1.7/Mon Feb 20 15:39:47 2006//Tv20101027
-D
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Repository
deleted file mode 100644
index fe29aa35c..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/DBTests.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/DBTests.java
deleted file mode 100755
index 9cf372d21..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/DBTests.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.tests;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.test.internal.performance.InternalDimensions;
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Scalar;
-import org.eclipse.test.internal.performance.db.DB;
-import org.eclipse.test.internal.performance.db.Scenario;
-import org.eclipse.test.internal.performance.db.SummaryEntry;
-import org.eclipse.test.internal.performance.db.Variations;
-import org.eclipse.test.performance.Dimension;
-import org.eclipse.test.performance.Performance;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-
-public class DBTests extends TestCase {
-
- private static final String CONFIG= "c"; //$NON-NLS-1$
- private static final String BUILD= "b"; //$NON-NLS-1$
-
- private static final String SCENARIO_NAME_0= "bar.testScenario0"; //$NON-NLS-1$
- private static final String SCENARIO_NAME_1= "bar.testScenario1"; //$NON-NLS-1$
- private static final String SCENARIO_NAME_2= "bar.testScenario2"; //$NON-NLS-1$
- private static final String SCENARIO_NAME_3= "foo.testScenario3"; //$NON-NLS-1$
- private static final String SCENARIO_NAME_4= "foo.testScenario4"; //$NON-NLS-1$
- private static final String SHORT_NAME_2= "ShortName2"; //$NON-NLS-1$
- private static final String SHORT_NAME_3= "ShortName3"; //$NON-NLS-1$
- private static final String SHORT_NAME_4= "ShortName4"; //$NON-NLS-1$
-
- private static final String DBLOC= "testDBs"; //$NON-NLS-1$
- //private static final String DBLOC= "net://localhost"; //$NON-NLS-1$
- private static String DBNAME;
- private static final String DBUSER= "testUser"; //$NON-NLS-1$
- private static final String DBPASSWD= "testPassword"; //$NON-NLS-1$
-
-
- protected void setUp() throws Exception {
- super.setUp();
-
- // generate a unique DB name
- DBNAME= "testDB_" + new Date().getTime(); //$NON-NLS-1$
-
- System.setProperty("eclipse.perf.dbloc", DBLOC + ";dbname=" + DBNAME + ";dbuser=" + DBUSER + ";dbpasswd=" + DBPASSWD); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- System.setProperty("eclipse.perf.config", CONFIG+"=test;"+BUILD+"=b0001;jvm=sun142"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.setProperty("eclipse.perf.assertAgainst", BUILD+"=base"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testPropertyGetters() {
- assertEquals(DBLOC, PerformanceTestPlugin.getDBLocation());
- assertEquals(DBNAME, PerformanceTestPlugin.getDBName());
- assertEquals(DBUSER, PerformanceTestPlugin.getDBUser());
- assertEquals(DBPASSWD, PerformanceTestPlugin.getDBPassword());
-
- assertEquals("|"+BUILD+"=b0001||"+CONFIG+"=test||jvm=sun142|", PerformanceTestPlugin.getVariations().toExactMatchString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- assertEquals("|"+BUILD+"=base||"+CONFIG+"=test||jvm=sun142|", PerformanceTestPlugin.getAssertAgainst().toExactMatchString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testAssertPerformance() throws SQLException {
-
- Performance perf= Performance.getDefault();
-
- // set the variation for the reference data
- System.setProperty("eclipse.perf.config", CONFIG+"=test;"+BUILD+"=ref"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- // store a reference value
- TestPerformanceMeter pm1= new TestPerformanceMeter(SCENARIO_NAME_0);
- pm1.addPair(InternalDimensions.CPU_TIME, 100, 1000);
- pm1.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
-
- pm1.start();
- pm1.stop();
- pm1.commit();
- pm1.dispose();
-
- String build= "001"; //$NON-NLS-1$
- // set the variation for the this run
- System.setProperty("eclipse.perf.config", CONFIG+"=test;"+BUILD+"="+build); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- // assert that this run's values are compared against reference data
- System.setProperty("eclipse.perf.assertAgainst", BUILD+"=ref"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // store a reference value
- TestPerformanceMeter pm2= new TestPerformanceMeter(SCENARIO_NAME_0);
- pm2.addPair(InternalDimensions.CPU_TIME, 100, 1100);
- pm2.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
-
- pm2.start();
- pm2.stop();
- pm2.commit();
- boolean failed= false;
- try {
- perf.assertPerformanceInRelativeBand(pm2, InternalDimensions.CPU_TIME, -5, +5);
- } catch (AssertionFailedError e) {
- failed= true;
- }
- pm2.dispose();
-
- if (!failed) {
- // check in DB
- Variations v= new Variations();
- v.put(CONFIG, "%"); //$NON-NLS-1$
- v.put(BUILD, build);
- Scenario[] scenarios= DB.queryScenarios(v, SCENARIO_NAME_0, CONFIG, null);
- if (scenarios != null && scenarios.length > 0) {
- Scenario s= scenarios[0];
- String[] failureMessages= s.getFailureMessages();
- if (failureMessages.length == 1) {
- String mesg= failureMessages[0];
- if (mesg != null && mesg.equals("Performance criteria not met when compared to '{b=ref, c=test}':\nCPU Time: 1 s is not within [95%, 105%] of 900 ms")) //$NON-NLS-1$
- failed= true;
- }
- }
- }
- assertTrue(failed);
- }
-
- public void testBasicDBFunctionality() {
-
- Performance perf= Performance.getDefault();
-
- TestPerformanceMeter pm1= new TestPerformanceMeter(SCENARIO_NAME_1);
- pm1.addPair(InternalDimensions.CPU_TIME, 100, 1000);
- pm1.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
- pm1.start();
- pm1.stop();
- pm1.commit();
- pm1.dispose();
-
- TestPerformanceMeter pm2= new TestPerformanceMeter(SCENARIO_NAME_2);
- pm2.addPair(InternalDimensions.CPU_TIME, 100, 1000);
- pm2.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
- perf.tagAsGlobalSummary(pm2, SHORT_NAME_2, new Dimension[] { Dimension.CPU_TIME, Dimension.USED_JAVA_HEAP } );
- pm2.start();
- pm2.stop();
- pm2.commit();
- pm2.dispose();
-
- TestPerformanceMeter pm3= new TestPerformanceMeter(SCENARIO_NAME_3);
- pm3.addPair(InternalDimensions.CPU_TIME, 100, 1000);
- pm3.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
- perf.tagAsGlobalSummary(pm3, SHORT_NAME_3, Dimension.CPU_TIME);
- pm3.start();
- pm3.stop();
- pm3.commit();
- pm3.dispose();
-
- TestPerformanceMeter pm4= new TestPerformanceMeter(SCENARIO_NAME_4);
- pm4.addPair(InternalDimensions.CPU_TIME, 100, 1000);
- pm4.addPair(InternalDimensions.WORKING_SET, 1000, 2000);
- perf.tagAsSummary(pm4, SHORT_NAME_4, Dimension.USED_JAVA_HEAP);
- pm4.start();
- pm4.stop();
- pm4.commit();
- pm4.dispose();
-
- //
-
- Variations v= new Variations();
- v.put(CONFIG, "test"); //$NON-NLS-1$
- v.put(BUILD, "b0001"); //$NON-NLS-1$
- v.put("jvm", "sun142"); //$NON-NLS-1$ //$NON-NLS-2$
- DataPoint[] points= DB.queryDataPoints(v, SCENARIO_NAME_1, null);
- assertEquals(1, points.length);
-
- DataPoint dp= points[0];
- Dim[] dimensions= dp.getDimensions();
- assertEquals(2, dimensions.length);
-
- Scalar s1= dp.getScalar(InternalDimensions.CPU_TIME);
- assertNotNull(s1);
- assertEquals(900, s1.getMagnitude());
-
- Scalar s2= dp.getScalar(InternalDimensions.WORKING_SET);
- assertNotNull(s2);
- assertEquals(1000, s2.getMagnitude());
-
- //
- Set dims= new HashSet();
- dims.add(InternalDimensions.WORKING_SET);
- points= DB.queryDataPoints(v, SCENARIO_NAME_1, dims);
- assertEquals(1, points.length);
- dimensions= points[0].getDimensions();
- assertEquals(1, dimensions.length);
- Scalar s= points[0].getScalar(InternalDimensions.WORKING_SET);
- assertNotNull(s);
- assertEquals(1000, s.getMagnitude());
-
- //
- List buildNames= new ArrayList();
- Variations v2= new Variations();
- v2.put(CONFIG, "%"); //$NON-NLS-1$
- v2.put(BUILD, "b%"); //$NON-NLS-1$
- DB.queryDistinctValues(buildNames, BUILD, v2, "%"); //$NON-NLS-1$
- assertEquals(1, buildNames.size());
- assertEquals("b0001", buildNames.get(0)); //$NON-NLS-1$
-
- SummaryEntry[] fps= DB.querySummaries(PerformanceTestPlugin.getVariations(), null);
- assertEquals(3, fps.length);
-
- assertEquals(SCENARIO_NAME_2, fps[0].scenarioName);
- assertEquals(SHORT_NAME_2, fps[0].shortName);
- assertEquals(Dimension.USED_JAVA_HEAP, fps[0].dimension);
-
- assertEquals(SCENARIO_NAME_2, fps[1].scenarioName);
- assertEquals(SHORT_NAME_2, fps[1].shortName);
- assertEquals(Dimension.CPU_TIME, fps[1].dimension);
-
- assertEquals(SCENARIO_NAME_3, fps[2].scenarioName);
- assertEquals(SHORT_NAME_3, fps[2].shortName);
- assertEquals(Dimension.CPU_TIME, fps[2].dimension);
-
-
- SummaryEntry[] fps2= DB.querySummaries(PerformanceTestPlugin.getVariations(), "foo.%"); //$NON-NLS-1$
- assertEquals(2, fps2.length);
-
- assertEquals(SCENARIO_NAME_3, fps2[0].scenarioName);
- assertEquals(SHORT_NAME_3, fps2[0].shortName);
- assertEquals(Dimension.CPU_TIME, fps2[0].dimension);
-
- assertEquals(SCENARIO_NAME_4, fps2[1].scenarioName);
- assertEquals(SHORT_NAME_4, fps2[1].shortName);
- assertEquals(Dimension.USED_JAVA_HEAP, fps2[1].dimension);
- }
-
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/PerformanceMeterFactoryTest.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/PerformanceMeterFactoryTest.java
deleted file mode 100755
index 5dc13f09b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/PerformanceMeterFactoryTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.tests;
-
-import org.eclipse.test.internal.performance.OSPerformanceMeter;
-import org.eclipse.test.performance.Performance;
-import org.eclipse.test.performance.PerformanceMeter;
-
-import junit.framework.TestCase;
-
-public class PerformanceMeterFactoryTest extends TestCase {
-
- public void testPerformanceMeterFactory() {
- System.setProperty("PerformanceMeterFactory", "org.eclipse.test.performance:org.eclipse.test.internal.performance.OSPerformanceMeterFactory"); //$NON-NLS-1$ //$NON-NLS-2$
-
- PerformanceMeter pm= Performance.getDefault().createPerformanceMeter("scenarioId"); //$NON-NLS-1$
-
- assertTrue(pm instanceof OSPerformanceMeter);
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/SimplePerformanceMeterTest.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/SimplePerformanceMeterTest.java
deleted file mode 100755
index e17290cff..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/SimplePerformanceMeterTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.test.internal.performance.OSPerformanceMeter;
-import org.eclipse.test.performance.Performance;
-import org.eclipse.test.performance.PerformanceMeter;
-
-public class SimplePerformanceMeterTest extends TestCase {
-
- public void testPerformanceMeterFactory() {
- PerformanceMeter meter= Performance.getDefault().createPerformanceMeter("scenarioId"); //$NON-NLS-1$
-
- assertTrue(meter instanceof OSPerformanceMeter);
-
- meter.start();
- meter.stop();
-
- meter.commit();
-
- meter.dispose();
- }
-
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/TestPerformanceMeter.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/TestPerformanceMeter.java
deleted file mode 100755
index f938fd780..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/TestPerformanceMeter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.internal.performance.tests;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.test.internal.performance.InternalPerformanceMeter;
-import org.eclipse.test.internal.performance.data.DataPoint;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.data.Sample;
-import org.eclipse.test.internal.performance.data.Scalar;
-
-
-/**
- * Mock performance meter that generates deterministic values for two dimensions.
- */
-class TestPerformanceMeter extends InternalPerformanceMeter {
-
- private long fStartTime;
- private List fDataPoints= new ArrayList();
- private Map fStart= new HashMap();
- private Map fStop= new HashMap();
-
- /**
- * @param scenarioId the scenario id
- */
- TestPerformanceMeter(String scenarioId) {
- super(scenarioId);
- fStartTime= System.currentTimeMillis();
- }
-
- void addPair(Dim dimension, long start, long end) {
- fStart.put(dimension, new Scalar(dimension, start));
- fStop.put(dimension, new Scalar(dimension, end));
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#dispose()
- */
- public void dispose() {
- fDataPoints= null;
- super.dispose();
- }
-
- /*
- * @see org.eclipse.test.internal.performance.InternalPerformanceMeter#getSample()
- */
- public Sample getSample() {
- if (fDataPoints != null)
- return new Sample(getScenarioName(), fStartTime, new HashMap(), (DataPoint[]) fDataPoints.toArray(new DataPoint[fDataPoints.size()]));
- return null;
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#start()
- */
- public void start() {
- fDataPoints.add(new DataPoint(BEFORE, fStart));
- }
-
- /*
- * @see org.eclipse.test.performance.PerformanceMeter#stop()
- */
- public void stop() {
- fDataPoints.add(new DataPoint(AFTER, fStop));
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/VariationsTests.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/VariationsTests.java
deleted file mode 100755
index c1c6f0a1c..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/internal/performance/tests/VariationsTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.internal.performance.tests;
-
-import org.eclipse.test.internal.performance.db.Variations;
-
-import junit.framework.TestCase;
-
-public class VariationsTests extends TestCase {
-
- public void testVariations() {
- Variations v1= new Variations();
- v1.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("|k1=foo|", v1.toExactMatchString()); //$NON-NLS-1$
- assertEquals("%|k1=foo|%", v1.toQueryPattern()); //$NON-NLS-1$
-
- Variations v2= new Variations();
- v2.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
- v2.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("|k1=foo||k2=bar|", v2.toExactMatchString()); //$NON-NLS-1$
- assertEquals("%|k1=foo|%|k2=bar|%", v2.toQueryPattern()); //$NON-NLS-1$
-
- Variations v3= new Variations();
- v3.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
- v3.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
- v3.put("k3", "xyz"); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("|k1=foo||k2=bar||k3=xyz|", v3.toExactMatchString()); //$NON-NLS-1$
- assertEquals("%|k1=foo|%|k2=bar|%|k3=xyz|%", v3.toQueryPattern()); //$NON-NLS-1$
-}
-
- public void testParseVariations() {
- Variations v1= new Variations();
- v1.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
-
- Variations v= new Variations();
- v.parseDB(v1.toExactMatchString());
- assertEquals(v1, v);
-
- Variations v2= new Variations();
- v2.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
- v2.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
- v= new Variations();
- v.parseDB(v2.toExactMatchString());
- assertEquals(v2, v);
-
- Variations v3= new Variations();
- v3.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
- v3.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
- v3.put("k3", "xyz"); //$NON-NLS-1$ //$NON-NLS-2$
- v= new Variations();
- v.parseDB(v3.toExactMatchString());
- assertEquals(v3, v);
- }
-
-// public void testMaxLength() {
-// StringBuffer sb= new StringBuffer();
-// for (int i= 0; i < 1000; i++)
-// sb.append("0123456789"); //$NON-NLS-1$
-// Variations v= new Variations(sb.toString(), null);
-//
-// String s1= v.toExactMatchString();
-// assertTrue(s1.length() == 10000);
-//
-// String s2= v.toQueryPattern();
-// assertTrue(s2.length() == 10000);
-// }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Entries b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Entries
deleted file mode 100644
index 167c61f10..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Entries
+++ /dev/null
@@ -1,5 +0,0 @@
-/Dimension.java/1.7/Mon Feb 20 15:39:46 2006//Tv20101027
-/Performance.java/1.20/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceMeter.java/1.4/Mon Feb 20 15:39:46 2006//Tv20101027
-/PerformanceTestCase.java/1.11/Mon Apr 13 19:19:19 2009//Tv20101027
-D
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Repository b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Repository
deleted file mode 100644
index 59c661e73..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.test.performance/src/org/eclipse/test/performance
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Root b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Root
deleted file mode 100644
index 2d37d165b..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Tag b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Tag
deleted file mode 100644
index c59e0cbe1..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/CVS/Tag
+++ /dev/null
@@ -1 +0,0 @@
-Nv20101027
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Dimension.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Dimension.java
deleted file mode 100755
index 2f0447b36..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Dimension.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.performance;
-
-import org.eclipse.test.internal.performance.InternalDimensions;
-
-/**
- * Some predefined dimensions most likely supported on all platforms.
- *
- * This interface is not intended to be implemented by clients.
- *
- * @since 3.1
- */
-public interface Dimension {
-
- // Dimensions available on all platforms:
-
- /**
- * The amount of time that the process has executed in kernel mode.
- * It is calculated by taking the sum of the time that each of the threads of the process has executed in kernel mode.
- */
- public Dimension KERNEL_TIME= InternalDimensions.KERNEL_TIME;
-
- /**
- * The amount of CPU time used so far by this process.
- * It is calculated by adding the KERNEL_TIME and the amount of time that the process has executed in user mode.
- * The user time is calculated by taking the sum of the time that each of the threads of the process has executed in user mode.
- * It does not include any time where the process is waiting for OS resources.
- * It is the best approximation for ELAPSED_PROCESS (which is not available on all platforms).
- */
- public Dimension CPU_TIME= InternalDimensions.CPU_TIME;
-
- /**
- * WORKING_SET is the amount of memory in the working set of this process.
- * The working set is the set of memory pages touched recently by the threads in the process.
- * If free memory in the computer is above a threshold, pages are left in the working set of a process
- * even if they are not in use. When free memory falls below a threshold, pages are removed from
- * working sets.
- */
- public Dimension WORKING_SET= InternalDimensions.WORKING_SET;
-
- /**
- * The total elapsed time this process has been running.
- * Since it starts at 0 on process start it can be used to measure startup time.
- * On Windows it is calculated by subtracting the creation time of the process from the current system time.
- * On Linux it is calculated by subtracting the value of the system property "eclipse.startTime" from
- * System.currentTimeMillis()
- * Please note that in contrast to the CPU_TIME the elapsed time of a process is influenced by other
- * processes running in parallel.
- */
- public Dimension ELAPSED_PROCESS= InternalDimensions.ELAPSED_PROCESS;
-
- /**
- * The amount of memory used in the JVM.
- * It is calculated by subtracting <code>Runtime.freeMemory()</code> from <code>Runtime.totalMemory()</code>.
- */
- public Dimension USED_JAVA_HEAP= InternalDimensions.USED_JAVA_HEAP;
-
- // the following Dimensions not available on all platforms!
-
- /**
- * WORKING_SET_PEAK is the maximum amount of memory in the working set of this process at any point in time.
- * The working set is the set of memory pages touched recently by the threads in the process.
- * If free memory in the computer is above a threshold, pages are left in the working set of a process
- * even if they are not in use. When free memory falls below a threshold, pages are removed from working sets.
- * Currently this dimension is only available on Windows.
- */
- public Dimension WORKING_SET_PEAK= InternalDimensions.WORKING_SET_PEAK;
-
- /**
- * The total amount of committed memory (for the entire machine).
- * Committed memory is the size of virtual memory that has been committed (as opposed to simply reserved).
- * Committed memory must have backing (i.e., disk) storage available, or must be assured never to need disk
- * storage (because main memory is large enough to hold it.) Notice that this is an instantaneous count,
- * not an average over the time interval.
- * Currently this dimension is only available on Windows.
- */
- public Dimension COMITTED= InternalDimensions.COMITTED;
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Performance.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Performance.java
deleted file mode 100755
index 646379f74..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/Performance.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.performance;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.test.internal.performance.InternalDimensions;
-import org.eclipse.test.internal.performance.InternalPerformanceMeter;
-import org.eclipse.test.internal.performance.NullPerformanceMeter;
-import org.eclipse.test.internal.performance.OSPerformanceMeterFactory;
-import org.eclipse.test.internal.performance.PerformanceMeterFactory;
-import org.eclipse.test.internal.performance.PerformanceTestPlugin;
-import org.eclipse.test.internal.performance.data.Dim;
-import org.eclipse.test.internal.performance.eval.AbsoluteBandChecker;
-import org.eclipse.test.internal.performance.eval.AssertChecker;
-import org.eclipse.test.internal.performance.eval.Evaluator;
-import org.eclipse.test.internal.performance.eval.IEvaluator;
-import org.eclipse.test.internal.performance.eval.RelativeBandChecker;
-import org.osgi.framework.Bundle;
-
-/**
- * Helper for performance measurements. Currently provides performance meter
- * creation and checking of measurements.
- *
- * This class is not intended to be subclassed by clients.
- *
- * @since 3.1
- */
-public class Performance {
-
- /**
- * A comment kind of a comment that explains a performance degradation.
- */
- public static final int EXPLAINS_DEGRADATION_COMMENT= 1;
-
- private static final String PERFORMANCE_METER_FACTORY= "/option/performanceMeterFactory"; //$NON-NLS-1$
- private static final String PERFORMANCE_METER_FACTORY_PROPERTY= "PerformanceMeterFactory"; //$NON-NLS-1$
-
- private static Performance fgDefault;
-
- private PerformanceMeterFactory fPerformanceMeterFactory;
- private IEvaluator fDefaultEvaluator;
-
- /** Null performance meter singleton */
- private NullPerformanceMeter fNullPeformanceMeter;
-
-
- /**
- * Private constructor to block instance creation.
- */
- private Performance() {
- // empty
- }
-
- /**
- * Returns the singleton of <code>Performance</code>
- *
- * @return the singleton of <code>Performance</code>
- */
- public static Performance getDefault() {
- if (fgDefault == null)
- fgDefault= new Performance();
- return fgDefault;
- }
-
- /**
- * Asserts default properties of the measurements captured by the given
- * performance meter.
- *
- * @param performanceMeter the performance meter
- * @throws RuntimeException if the properties do not hold
- */
- public void assertPerformance(PerformanceMeter performanceMeter) {
- if (fDefaultEvaluator == null) {
- fDefaultEvaluator= new Evaluator();
- fDefaultEvaluator.setAssertCheckers(new AssertChecker[] {
- new RelativeBandChecker(InternalDimensions.ELAPSED_PROCESS, 0.0f, 1.10f),
- //new RelativeBandChecker(InternalDimensions.CPU_TIME, 0.0f, 1.10f),
- //new RelativeBandChecker(InternalDimensions.WORKING_SET, 0.0f, 3.00f),
- //new RelativeBandChecker(InternalDimensions.USED_JAVA_HEAP, 0.0f, 2.00f),
- //new RelativeBandChecker(InternalDimensions.SYSTEM_TIME, 0.0f, 1.10f)
- });
- }
- fDefaultEvaluator.evaluate(performanceMeter);
- }
-
- /**
- * Asserts that the measurement specified by the dimension captured in the given
- * performance meter is within a certain range with respect to some reference value.
- * If the performance meter doesn't provide the specified dimension, the call has no effect.
- *
- * @param performanceMeter the performance meter
- * @param dim the Dimension to check
- * @param lowerPercentage a negative number indicating the percentage the measured value is allowed to be smaller than some reference value
- * @param upperPercentage a positive number indicating the percentage the measured value is allowed to be greater than some reference value
- * @throws RuntimeException if the properties do not hold
- */
- public void assertPerformanceInRelativeBand(PerformanceMeter performanceMeter, Dimension dim, int lowerPercentage, int upperPercentage) {
- Evaluator e= new Evaluator();
- e.setAssertCheckers(new AssertChecker[] {
- new RelativeBandChecker((Dim) dim, 1.0+(lowerPercentage / 100.0), 1.0+(upperPercentage / 100.0)),
- });
- e.evaluate(performanceMeter);
- }
-
- /**
- * Asserts that the measurement specified by the dimension captured in the given
- * performance meter is within a certain range with respect to some reference value.
- * If the performance meter doesn't provide the specified dimension, the call has no effect.
- *
- * @param performanceMeter the performance meter
- * @param dim the Dimension to check
- * @param lowerBand a negative number indicating the absolute amount the measured value is allowed to be smaller than some reference value
- * @param upperBand a positive number indicating the absolute amount the measured value is allowed to be greater than some reference value
- * @throws RuntimeException if the properties do not hold
- */
- public void assertPerformanceInAbsoluteBand(PerformanceMeter performanceMeter, Dimension dim, int lowerBand, int upperBand) {
- Evaluator e= new Evaluator();
- e.setAssertCheckers(new AssertChecker[] {
- new AbsoluteBandChecker((Dim) dim, lowerBand, upperBand),
- });
- e.evaluate(performanceMeter);
- }
-
- /**
- * Creates a performance meter for the given scenario id.
- *
- * @param scenarioId the scenario id
- * @return a performance meter for the given scenario id
- * @throws IllegalArgumentException if a performance meter for the given
- * scenario id has already been created
- */
- public PerformanceMeter createPerformanceMeter(String scenarioId) {
- return getPeformanceMeterFactory().createPerformanceMeter(scenarioId);
- }
-
- /**
- * Returns the null performance meter singleton.
- *
- * @return the null performance meter singleton
- */
- public PerformanceMeter getNullPerformanceMeter() {
- if (fNullPeformanceMeter == null)
- fNullPeformanceMeter= new NullPerformanceMeter();
- return fNullPeformanceMeter;
- }
-
- /**
- * Returns a default scenario id for the given test. The test's name
- * must have been set, such that <code>test.getName()</code> is not
- * <code>null</code>.
- *
- * @param test the test
- * @return the default scenario id for the test
- */
- public String getDefaultScenarioId(TestCase test) {
- return test.getClass().getName() + '#' + test.getName() + "()"; //$NON-NLS-1$
- }
-
- /**
- * Returns a default scenario id for the given test and id. The test's
- * name must have been set, such that <code>test.getName()</code> is
- * not <code>null</code>. The id distinguishes multiple scenarios in
- * the same test.
- *
- * @param test the test
- * @param id the id
- * @return the default scenario id for the test and the id
- */
- public String getDefaultScenarioId(TestCase test, String id) {
- return getDefaultScenarioId(test) + '-' + id;
- }
-
- private PerformanceMeterFactory getPeformanceMeterFactory() {
- if (fPerformanceMeterFactory == null)
- fPerformanceMeterFactory= createPerformanceMeterFactory();
- return fPerformanceMeterFactory;
- }
-
- private PerformanceMeterFactory createPerformanceMeterFactory() {
- PerformanceMeterFactory factory;
- factory= tryInstantiate(System.getProperty(PERFORMANCE_METER_FACTORY_PROPERTY));
- if (factory != null)
- return factory;
-
- factory= tryInstantiate(Platform.getDebugOption(PerformanceTestPlugin.PLUGIN_ID + PERFORMANCE_METER_FACTORY));
- if (factory != null)
- return factory;
-
- return createDefaultPerformanceMeterFactory();
- }
-
- private PerformanceMeterFactory tryInstantiate(String className) {
- PerformanceMeterFactory instance= null;
- if (className != null && className.length() > 0) {
- try {
- int separator= className.indexOf(':');
- Bundle bundle= null;
- if (separator == -1) {
- bundle= PerformanceTestPlugin.getDefault().getBundle();
- } else {
- String bundleName= className.substring(0, separator);
- className= className.substring(separator + 1);
- bundle= Platform.getBundle(bundleName);
- }
- Class c= bundle.loadClass(className);
- instance= (PerformanceMeterFactory) c.newInstance();
- } catch (ClassNotFoundException e) {
- PerformanceTestPlugin.log(e);
- } catch (InstantiationException e) {
- PerformanceTestPlugin.log(e);
- } catch (IllegalAccessException e) {
- PerformanceTestPlugin.log(e);
- } catch (ClassCastException e) {
- PerformanceTestPlugin.log(e);
- }
- }
- return instance;
- }
-
- private PerformanceMeterFactory createDefaultPerformanceMeterFactory() {
- return new OSPerformanceMeterFactory();
- }
-
- /**
- * Mark the scenario represented by the given PerformanceMeter
- * to be included into the global and the component performance summary. The summary shows
- * the given dimension of the scenario and labels the scenario with the short name.
- *
- * @param pm the PerformanceMeter
- * @param shortName a short (shorter than 40 characters) descriptive name of the scenario
- * @param dimension the dimension to show in the summary
- */
- public void tagAsGlobalSummary(PerformanceMeter pm, String shortName, Dimension dimension) {
- tagAsGlobalSummary(pm, shortName, new Dimension[] { dimension } );
- }
-
- /**
- * Mark the scenario represented by the given PerformanceMeter
- * to be included into the global and the component performance summary. The summary shows
- * the given dimensions of the scenario and labels the scenario with the short name.
- *
- * @param pm the PerformanceMeter
- * @param shortName a short (shorter than 40 characters) descriptive name of the scenario
- * @param dimensions an array of dimensions to show in the summary
- */
- public void tagAsGlobalSummary(PerformanceMeter pm, String shortName, Dimension[] dimensions) {
- if (pm instanceof InternalPerformanceMeter) {
- InternalPerformanceMeter ipm= (InternalPerformanceMeter) pm;
- ipm.tagAsSummary(true, shortName, dimensions);
- }
- }
-
-
- /**
- * Mark the scenario represented by the given PerformanceMeter
- * to be included into the component performance summary. The summary shows
- * the given dimension of the scenario and labels the scenario with the short name.
- *
- * @param pm the PerformanceMeter
- * @param shortName a short (shorter than 40 characters) descriptive name of the scenario
- * @param dimension the dimension to show in the summary
- */
- public void tagAsSummary(PerformanceMeter pm, String shortName, Dimension dimension) {
- tagAsSummary(pm, shortName, new Dimension[] { dimension } );
- }
-
- /**
- * Mark the scenario represented by the given PerformanceMeter
- * to be included into the component performance summary. The summary shows
- * the given dimensions of the scenario and labels the scenario with the short name.
- *
- * @param pm the PerformanceMeter
- * @param shortName a short (shorter than 40 characters) descriptive name of the scenario
- * @param dimensions an array of dimensions to show in the summary
- */
- public void tagAsSummary(PerformanceMeter pm, String shortName, Dimension[] dimensions) {
- if (pm instanceof InternalPerformanceMeter) {
- InternalPerformanceMeter ipm= (InternalPerformanceMeter) pm;
- ipm.tagAsSummary(false, shortName, dimensions);
- }
- }
-
- /**
- * Set a comment for the scenario represented by the given PerformanceMeter.
- * Currently only comments with a commentKind of EXPLAINS_DEGRADATION_COMMENT are used.
- * Their commentText is shown in a hover of the performance summaries graph if a performance
- * degradation exists.
- *
- * @param pm the PerformanceMeter
- * @param commentKind kind of comment. Must be EXPLAINS_DEGRADATION_COMMENT to have an effect.
- * @param commentText the comment (shorter than 400 characters)
- */
- public void setComment(PerformanceMeter pm, int commentKind, String commentText) {
- if (commentKind == EXPLAINS_DEGRADATION_COMMENT) {
- if (pm instanceof InternalPerformanceMeter) {
- InternalPerformanceMeter ipm= (InternalPerformanceMeter) pm;
- ipm.setComment(commentKind, commentText);
- }
- }
- }
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceMeter.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceMeter.java
deleted file mode 100755
index 86ed9c94c..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceMeter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.test.performance;
-
-/**
- * A <code>PerformanceMeter</code> is used for doing repeated measurements of
- * an arbitrary operation.
- *
- * The kind of measurement and the retrieval of the results remain internal to
- * the implementation. Measurements can include time, CPU cycle and memory
- * consumption.
- *
- * A <code>PerformanceMeter</code> is created using the method
- * {@link Performance#createPerformanceMeter(String)}. An operation is measured
- * by calling {@link PerformanceMeter#start()} before and
- * {@link PerformanceMeter#stop()} after that operation. The measurement can be
- * repeated, for example, to let the VM warm up and to allow for statistical
- * analysis afterwards.
- *
- * After measurements are done and before an analysis of the results can be made
- * {@link PerformanceMeter#commit()} has to be called. This allows for example
- * to prepare the measurements for analysis or persist them.
- * {@link Performance#assertPerformance(PerformanceMeter)} provides a default
- * analysis of the measurements. After the <code>PerformanceMeter</code> is no
- * longer used {@link PerformanceMeter#dispose()} must be called.
- *
- * Example usage in a test case:
- * <pre>
- * public void testOpenEditor() {
- * Performance perf= Performance.getDefault();
- * PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this));
- * try {
- * for (int i= 0; i &lt; 10; i++) {
- * performanceMeter.start();
- * openEditor();
- * performanceMeter.stop();
- * closeEditor();
- * }
- * performanceMeter.commit();
- * perf.assertPerformance(performanceMeter);
- * } finally {
- * performanceMeter.dispose();
- * }
- * }
- * </pre>
- *
- * This class is not intended to be subclassed by clients.
- */
-public abstract class PerformanceMeter {
-
- /**
- * Called immediately before the operation to measure. Must be followed
- * by a call to {@link PerformanceMeter#stop()} before subsequent calls
- * to this method or {@link PerformanceMeter#commit()}.
- */
- public abstract void start();
-
- /**
- * Called immediately after the operation to measure. Must be preceded
- * by a call to {@link PerformanceMeter#start()}, that follows any
- * previous call to this method.
- */
- public abstract void stop();
-
- /**
- * Called exactly once after repeated measurements are done and before
- * their analysis. Afterwards {@link PerformanceMeter#start()} and
- * {@link PerformanceMeter#stop()} must not be called.
- */
- public abstract void commit();
-
- /**
- * Dispose associated resources. Clients must call this method exactly
- * once. Afterwards no methods must be called on the performance meter.
- */
- public abstract void dispose();
-}
diff --git a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceTestCase.java b/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceTestCase.java
deleted file mode 100755
index 807a56906..000000000
--- a/FROMCVS/org.eclipse.test.performance/src/org/eclipse/test/performance/PerformanceTestCase.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.test.performance;
-
-import junit.framework.TestCase;
-
-/**
- * A PerformanceTestCase is a convenience class that takes care of managing
- * a <code>PerformanceMeter</code>.
- * <p>
- * Here is an example:
- * <pre>
- * public class MyPerformanceTestCase extends PeformanceTestCase {
- *
- * public void testMyOperation() {
- * for (int i= 0; i < 10; i++) {
- * // preparation
- * startMeasuring();
- * // my operation
- * stopMeasuring();
- * // clean up
- * }
- * commitMeasurements();
- * assertPerformance();
- * }
- * }
- */
-public class PerformanceTestCase extends TestCase {
-
- protected PerformanceMeter fPerformanceMeter;
-
- /**
- * Constructs a performance test case.
- */
- public PerformanceTestCase() {
- super();
- }
-
- /**
- * Constructs a performance test case with the given name.
- * @param name the name of the performance test case
- */
- public PerformanceTestCase(String name) {
- super(name);
- }
-
- /**
- * Overridden to create a default performance meter for this test case.
- * @throws Exception
- */
- protected void setUp() throws Exception {
- Performance performance= Performance.getDefault();
- fPerformanceMeter= performance.createPerformanceMeter(performance.getDefaultScenarioId(this));
- }
-
- /**
- * Overridden to dispose of the performance meter.
- * @throws Exception
- */
- protected void tearDown() throws Exception {
- fPerformanceMeter.dispose();
- }
-
- /**
- * Mark the scenario of this test case
- * to be included into the global and the component performance summary. The summary shows
- * the given dimension of the scenario and labels the scenario with the short name.
- *
- * @param shortName a short (shorter than 40 characters) descritive name of the scenario
- * @param dimension the dimension to show in the summary
- */
- public void tagAsGlobalSummary(String shortName, Dimension dimension) {
- Performance performance= Performance.getDefault();
- performance.tagAsGlobalSummary(fPerformanceMeter, shortName, new Dimension[] { dimension } );
- }
-
- /**
- * Mark the scenario represented by the given PerformanceMeter
- * to be included into the global and the component performance summary. The summary shows
- * the given dimensions of the scenario and labels the scenario with the short name.
- *
- * @param shortName a short (shorter than 40 characters) descritive name of the scenario
- * @param dimensions an array of dimensions to show in the summary
- */
- public void tagAsGlobalSummary(String shortName, Dimension[] dimensions) {
- Performance performance= Performance.getDefault();
- performance.tagAsGlobalSummary(fPerformanceMeter, shortName, dimensions );
- }
-
- /**
- * Mark the scenario of this test case
- * to be included into the component performance summary. The summary shows
- * the given dimension of the scenario and labels the scenario with the short name.
- *
- * @param shortName a short (shorter than 40 characters) descritive name of the scenario
- * @param dimension the dimension to show in the summary
- */
- public void tagAsSummary(String shortName, Dimension dimension) {
- Performance performance= Performance.getDefault();
- performance.tagAsSummary(fPerformanceMeter, shortName, new Dimension[] { dimension } );
- }
-
- /**
- * Mark the scenario represented by the given PerformanceMeter
- * to be included into the component performance summary. The summary shows
- * the given dimensions of the scenario and labels the scenario with the short name.
- *
- * @param shortName a short (shorter than 40 characters) descritive name of the scenario
- * @param dimensions an array of dimensions to show in the summary
- */
- public void tagAsSummary(String shortName, Dimension[] dimensions) {
- Performance performance= Performance.getDefault();
- performance.tagAsSummary(fPerformanceMeter, shortName, dimensions );
- }
-
- /**
- * Set a comment for the scenario represented by this TestCase.
- * Currently only comments with a commentKind of EXPLAINS_DEGRADATION_COMMENT are used.
- * Their commentText is shown in a hover of the performance summaries graph if a performance
- * degradation exists.
- *
- * @param commentKind kind of comment. Must be EXPLAINS_DEGRADATION_COMMENT to have an effect.
- * @param commentText the comment (shorter than 400 characters)
- */
- public void setComment(int commentKind, String commentText) {
- Performance performance= Performance.getDefault();
- performance.setComment(fPerformanceMeter, commentKind, commentText);
- }
-
- /**
- * Called from within a test case immediately before the code to measure is run.
- * It starts capturing of performance data.
- * Must be followed by a call to {@link PerformanceTestCase#stopMeasuring()} before subsequent calls
- * to this method or {@link PerformanceTestCase#commitMeasurements()}.
- *
- * @see PerformanceMeter#start()
- */
- protected void startMeasuring() {
- fPerformanceMeter.start();
- }
-
- /**
- * Called from within a test case immediately after the operation to measure.
- * Must be preceded by a call to {@link PerformanceTestCase#startMeasuring()}, that follows any
- * previous call to this method.
- *
- * @see PerformanceMeter#stop()
- */
- protected void stopMeasuring() {
- fPerformanceMeter.stop();
- }
-
- /**
- * Called exactly once after repeated measurements are done and before
- * their analysis. Afterwards {@link PerformanceTestCase#startMeasuring()} and
- * {@link PerformanceTestCase#stopMeasuring()} must not be called.
- *
- * @see PerformanceMeter#commit()
- */
- protected void commitMeasurements() {
- fPerformanceMeter.commit();
- }
-
- /**
- * Asserts default properties of the measurements captured for this test case.
- *
- * @throws RuntimeException if the properties do not hold
- */
- protected void assertPerformance() {
- Performance.getDefault().assertPerformance(fPerformanceMeter);
- }
-
- /**
- * Asserts that the measurement specified by the given dimension
- * is within a certain range with respect to some reference value.
- * If the specified dimension isn't available, the call has no effect.
- *
- * @param dim the Dimension to check
- * @param lowerPercentage a negative number indicating the percentage the measured value is allowed to be smaller than some reference value
- * @param upperPercentage a positive number indicating the percentage the measured value is allowed to be greater than some reference value
- * @throws RuntimeException if the properties do not hold
- */
- protected void assertPerformanceInRelativeBand(Dimension dim, int lowerPercentage, int upperPercentage) {
- Performance.getDefault().assertPerformanceInRelativeBand(fPerformanceMeter, dim, lowerPercentage, upperPercentage);
- }
-}

Back to the top