You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by do...@apache.org on 2011/03/20 19:54:14 UTC
svn commit: r1083534 - in
/lucene/dev/branches/branch_3x/lucene/contrib/benchmark: CHANGES.txt
src/java/org/apache/lucene/benchmark/byTask/Benchmark.java
Author: doronc
Date: Sun Mar 20 18:54:13 2011
New Revision: 1083534
URL: http://svn.apache.org/viewvc?rev=1083534&view=rev
Log:
LUCENE-2963: Easier way to run benchmark, by calling Benmchmark.exec(alg-file).
Modified:
lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt
lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/Benchmark.java
Modified: lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt?rev=1083534&r1=1083533&r2=1083534&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt Sun Mar 20 18:54:13 2011
@@ -2,6 +2,10 @@ Lucene Benchmark Contrib Change Log
The Benchmark contrib package contains code for benchmarking Lucene in a variety of ways.
+03/20/2011
+ LUCENE-2963: Easier way to run benchmark, by calling Benmchmark.exec(alg-file).
+ (Doron Cohen)
+
03/10/2011
LUCENE-2961: Removed lib/xml-apis.jar, since JVM 1.5+ already contains the
JAXP 1.3 interface classes it provides.
Modified: lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/Benchmark.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/Benchmark.java?rev=1083534&r1=1083533&r2=1083534&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/Benchmark.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/Benchmark.java Sun Mar 20 18:54:13 2011
@@ -64,6 +64,9 @@ public class Benchmark {
}
}
+ /**
+ * Execute this benchmark
+ */
public synchronized void execute() throws Exception {
if (executed) {
throw new IllegalStateException("Benchmark was already executed");
@@ -78,6 +81,14 @@ public class Benchmark {
* @param args benchmark config and algorithm files
*/
public static void main(String[] args) {
+ exec(args);
+ }
+
+ /**
+ * Utility: execute benchmark from command line
+ * @param args single argument is expected: algorithm-file
+ */
+ public static void exec(String[] args) {
// verify command line args
if (args.length < 1) {
System.err.println("Usage: java Benchmark <algorithm file>");
@@ -115,7 +126,6 @@ public class Benchmark {
System.out.println("####################");
System.out.println("### D O N E !!! ###");
System.out.println("####################");
-
}
/**