Author: chetanm
Date: Thu Sep 15 07:21:26 2016
New Revision: 1760872

URL: http://svn.apache.org/viewvc?rev=1760872&view=rev
Log:
OAK-4412 - Lucene hybrid index

Benchmarking - Report extra stats as part of main stats

Modified:
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/HybridIndexTest.java

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/HybridIndexTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/HybridIndexTest.java?rev=1760872&r1=1760871&r2=1760872&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/HybridIndexTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/HybridIndexTest.java
 Thu Sep 15 07:21:26 2016
@@ -45,6 +45,7 @@ import javax.jcr.query.QueryResult;
 import com.codahale.metrics.ConsoleReporter;
 import com.codahale.metrics.Metric;
 import com.codahale.metrics.MetricFilter;
+import com.google.common.base.Joiner;
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterators;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -242,12 +243,43 @@ public class HybridIndexTest extends Abs
                         "useOakCodec: %s %n",
                 numOfIndexes, refreshDeltaMillis, asyncInterval, queueSize, 
hybridIndexEnabled,
                 metricStatsEnabled, indexingMode, useOakCodec);
-        System.out.printf("Searcher: %d, Mutator: %d, indexedNodeCount: %d 
%n", searcher.resultSize,
-                mutator.mutationCount, indexedNodeCount.get());
 
         dumpStats();
     }
 
+    @Override
+    protected String[] statsNames() {
+        return new String[]{"Searcher", "Mutator", "Indexed"};
+    }
+
+    @Override
+    protected String[] statsFormats() {
+        return new String[]{"%8d", "%8d", "%8d"};
+    }
+
+    @Override
+    protected Object[] statsValues() {
+        return new Object[]{searcher.resultSize, mutator.mutationCount, 
indexedNodeCount.get()};
+    }
+
+    @Override
+    protected String comment() {
+        List<String> commentElements = new ArrayList<>();
+        if (hybridIndexEnabled){
+            commentElements.add(indexingMode);
+
+            if (useOakCodec){
+                commentElements.add("oakCodec");
+            }
+        } else {
+            commentElements.add("property");
+        }
+
+        commentElements.add("numIdxs:"+ numOfIndexes);
+        commentElements.add("async:"+ asyncInterval);
+        return Joiner.on(',').join(commentElements);
+    }
+
     private void dumpStats() {
         if (!metricStatsEnabled) {
             return;


Reply via email to