You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2010/08/16 18:01:03 UTC
svn commit: r986000 -
/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
Author: jukka
Date: Mon Aug 16 16:01:03 2010
New Revision: 986000
URL: http://svn.apache.org/viewvc?rev=986000&view=rev
Log:
JCR-2715: Improved join query performance
Better reporting of performance results
Modified:
jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java?rev=986000&r1=985999&r2=986000&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java (original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java Mon Aug 16 16:01:03 2010
@@ -65,8 +65,7 @@ public abstract class AbstractPerformanc
}
}
- private void testPerformance(String name, RepositoryImpl repository)
- throws Exception {
+ private void testPerformance(String name, RepositoryImpl repository) {
PerformanceTestSuite suite = new PerformanceTestSuite(
repository,
new SimpleCredentials("admin", "admin".toCharArray()));
@@ -85,34 +84,37 @@ public abstract class AbstractPerformanc
}
private void runTest(
- PerformanceTestSuite suite, AbstractTest test, String name)
- throws Exception {
- DescriptiveStatistics statistics = suite.runTest(test);
+ PerformanceTestSuite suite, AbstractTest test, String name) {
+ try {
+ DescriptiveStatistics statistics = suite.runTest(test);
- File base = new File("..", "base");
- File target = new File(base, "target");
- File report = new File(target, test + ".txt");
- boolean needsPrefix = !report.exists();
+ File base = new File("..", "base");
+ File target = new File(base, "target");
+ File report = new File(target, test + ".txt");
+ boolean needsPrefix = !report.exists();
+
+ PrintWriter writer = new PrintWriter(
+ new FileWriterWithEncoding(report, "UTF-8", true));
+ try {
+ if (needsPrefix) {
+ writer.format(
+ "# %-34.34s avg std min max count%n",
+ test);
+ }
- PrintWriter writer = new PrintWriter(
- new FileWriterWithEncoding(report, "UTF-8", true));
- try {
- if (needsPrefix) {
writer.format(
- "# %-34.34s avg std min max count%n",
- test);
+ "%-36.36s %6.0f %6.0f %6.0f %6.0f %6d%n",
+ name,
+ statistics.getMean(),
+ statistics.getStandardDeviation(),
+ statistics.getMin(),
+ statistics.getMax(),
+ statistics.getN());
+ } finally {
+ writer.close();
}
-
- writer.format(
- "%-36.36s %6.0f %6.0f %6.0f %6.0f %6d%n",
- name,
- statistics.getMean(),
- statistics.getStandardDeviation(),
- statistics.getMin(),
- statistics.getMax(),
- statistics.getN());
- } finally {
- writer.close();
+ } catch (Exception e) {
+ System.out.println("Unable to run " + test + ": " + e.getMessage());
}
}