Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-12-14 01:27:23 -0500
committerEike Stepper2011-12-14 01:27:23 -0500
commit6a8157025439c0f2c43f9153acd5e9be9f863bce (patch)
treec3e33a0eb23280667ef8a470a6e9bf88c6090341
parent7cb111de5eae0a63bdd46c702353f1442da0518e (diff)
downloadcdo-6a8157025439c0f2c43f9153acd5e9be9f863bce.tar.gz
cdo-6a8157025439c0f2c43f9153acd5e9be9f863bce.tar.xz
cdo-6a8157025439c0f2c43f9153acd5e9be9f863bce.zip
[237158] Provide Performance TestCase
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237158
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java44
2 files changed, 41 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java
index 32b7691509..154bb0b514 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java
@@ -52,4 +52,20 @@ public class PerformanceRecord
{
return probes;
}
-} \ No newline at end of file
+
+ public long getDurationSum()
+ {
+ long durationSum = 0L;
+ for (long probe : probes)
+ {
+ durationSum += probe;
+ }
+
+ return durationSum;
+ }
+
+ public long getDurationAvg()
+ {
+ return getDurationSum() / probes.length;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java
index a165322b46..28486e0855 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java
@@ -37,6 +37,16 @@ public class PrintStreamPerformanceRecordAnalyzer implements IPerformanceRecordA
public void analyze(List<PerformanceRecord> performanceRecords)
{
+ printHeader();
+
+ for (PerformanceRecord performanceRecord : performanceRecords)
+ {
+ printRecord(performanceRecord);
+ }
+ }
+
+ protected void printHeader()
+ {
String recordString = MessageFormat.format("{0};{1};{2};{3};{4};{5};{6}", //
"ContainerConfig", //
"RepositoryConfig", //
@@ -45,29 +55,23 @@ public class PrintStreamPerformanceRecordAnalyzer implements IPerformanceRecordA
"Test name", //
"Test Case Name", //
"Average Duration");
+
out.println(recordString);
+ }
- for (PerformanceRecord performanceRecord : performanceRecords)
- {
- long durationSum = 0L;
- for (long durationMillis : performanceRecord.getProbes())
- {
- durationSum += durationMillis;
- }
- long durationAverage = durationSum / performanceRecord.getProbes().length;
-
- IScenario scenario = performanceRecord.getScenario();
+ protected void printRecord(PerformanceRecord performanceRecord)
+ {
+ IScenario scenario = performanceRecord.getScenario();
- recordString = MessageFormat.format("{0};{1};{2};{3};{4};{5};{6}", //
- scenario.getContainerConfig().getName(), //
- scenario.getRepositoryConfig().getName(), //
- scenario.getSessionConfig().getName(), //
- scenario.getModelConfig().getName(), //
- performanceRecord.getTestName(), //
- performanceRecord.getTestCaseName(), //
- durationAverage);
+ String recordString = MessageFormat.format("{0};{1};{2};{3};{4};{5};{6}", //
+ scenario.getContainerConfig().getName(), //
+ scenario.getRepositoryConfig().getName(), //
+ scenario.getSessionConfig().getName(), //
+ scenario.getModelConfig().getName(), //
+ performanceRecord.getTestName(), //
+ performanceRecord.getTestCaseName(), //
+ performanceRecord.getDurationAvg());
- out.println(recordString);
- }
+ out.println(recordString);
}
}

Back to the top