I sort of felt that it should be done even when eraseIndex=false, but, how about instead we make it an explicit task, and don't reset the clock inside reinit()?

Here's the patch:

Index: src/java/org/apache/lucene/benchmark/byTask/tasks/ ResetLogClockTask.java
===================================================================
--- src/java/org/apache/lucene/benchmark/byTask/tasks/ ResetLogClockTask.java (revision 0) +++ src/java/org/apache/lucene/benchmark/byTask/tasks/ ResetLogClockTask.java (revision 0)
@@ -0,0 +1,36 @@
+package org.apache.lucene.benchmark.byTask.tasks;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.benchmark.byTask.PerfRunData;
+
+/**
+ * Simple class to reset the clock used when logging number
+ * of added documents.
+ */
+public class ResetLogClockTask extends PerfTask {
+
+  public ResetLogClockTask(PerfRunData runData) {
+    super(runData);
+  }
+
+  public int doLogic() throws Exception {
+    getRunData().setStartTimeMillis();
+    return 0;
+  }
+}

Property changes on: src/java/org/apache/lucene/benchmark/byTask/ tasks/ResetLogClockTask.java
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java
===================================================================
--- src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java (revision 618219) +++ src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java (working copy)
@@ -137,9 +137,6 @@
     // release unused stuff
     System.runFinalization();
     System.gc();
-
-    // Re-init clock
-    setStartTimeMillis();
   }

   public long setStartTimeMillis() {

Mike

Doron Cohen wrote:

------=_Part_13191_9991941.1202104409907
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Mike, do you think this should be done only when eraseIndex=true ?

On Sun, Feb 3, 2008 at 4:24 PM, <[EMAIL PROTECTED]> wrote:

Author: mikemccand
Date: Sun Feb  3 06:24:30 2008
New Revision: 617991

URL: http://svn.apache.org/viewvc?rev=617991&view=rev
Log:
when reinit() is called, reset the start time (used only when printing #
docs indexed)

Modified:

lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ benchmark/byTask/PerfRunData.java

Modified:
lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ benchmark/byTask/PerfRunData.java
URL:
http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/ src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java? rev=617991&r1=617990&r2=617991&view=diff

===================================================================== =========
---
lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ benchmark/byTask/PerfRunData.java
(original)
+++
lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ benchmark/byTask/PerfRunData.java
Sun Feb  3 06:24:30 2008
@@ -137,6 +137,9 @@
    // release unused stuff
    System.runFinalization();
    System.gc();
+
+    // Re-init clock
+    setStartTimeMillis();


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to