Apache Solr open-source search software
LUCENE-1027: Added better formatting of doubles, added wikipedia-flush-by-RAM for comparison
Grant Ingersollb7253a06b769
diff --git a/contrib/benchmark/conf/micro-standard-flush-by-ram.alg b/contrib/benchmark/conf/micro-standard-flush-by-ram.algindex f79b32c3b04..d01723ee6e8 100644--- a/contrib/benchmark/conf/micro-standard-flush-by-ram.alg+++ b/contrib/benchmark/conf/micro-standard-flush-by-ram.alg@@ -19,7 +19,7 @@#merge.factor=mrg:10:100:10:100#max.buffered=buf:10:10:100:100-ram.flush.mb=ram:32:40:48:56+ram.flush.mb=flush:32:40:48:56compound=trueanalyzer=org.apache.lucene.analysis.standard.StandardAnalyzerdiff --git a/contrib/benchmark/conf/standard-flush-by-RAM.alg b/contrib/benchmark/conf/standard-flush-by-RAM.algindex f13522171b1..0727876efb5 100644--- a/contrib/benchmark/conf/standard-flush-by-RAM.alg+++ b/contrib/benchmark/conf/standard-flush-by-RAM.alg@@ -19,7 +19,7 @@#merge.factor=mrg:10:100:10:100:10:100:10:100#max.buffered=buf:10:10:100:100:10:10:100:100-ram.flush.mb=ram:32:40:48:56:32:40:48:56+ram.flush.mb=flush:32:40:48:56:32:40:48:56compound=cmpnd:true:true:true:true:false:false:false:falseanalyzer=org.apache.lucene.analysis.standard.StandardAnalyzerdiff --git a/contrib/benchmark/conf/wikipedia-flush-by-RAM.alg b/contrib/benchmark/conf/wikipedia-flush-by-RAM.algnew file mode 100644index 00000000000..f1393bd06aa--- /dev/null+++ b/contrib/benchmark/conf/wikipedia-flush-by-RAM.alg@@ -0,0 +1,69 @@+#/**+# * 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.+# */+# -------------------------------------------------------------------------------------+# multi val params are iterated by NewRound's, added to reports, start with column name.+#+# based on micro-standard+#+# modified to use wikipedia sources and index entire docs+# currently just used to measure ingest rate++#merge.factor=mrg:10:100:10:100+#max.buffered=buf:10:10:100:100+ram.flush.mb=ram:32:40:48:56++max.field.length=2147483647+++compound=true++analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer+directory=FSDirectory++doc.stored=true+doc.tokenized=true+doc.term.vector=false+doc.add.log.step=500++docs.dir=enwiki++doc.maker=org.apache.lucene.benchmark.byTask.feeds.DirDocMaker++query.maker=org.apache.lucene.benchmark.byTask.feeds.ReutersQueryMaker++# task at this depth or less would print when they start+task.max.depth.log=2++log.queries=false+# -------------------------------------------------------------------------------------++{ "Rounds"++ ResetSystemErase++ { "Populate"+ CreateIndex+ { "MAddDocs" AddDoc > : 200000+ CloseIndex+ }++ NewRound++} : 8++RepSumByName+RepSumByPrefRound MAddDocsdiff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.javaindex 5c2ff0c7737..bcb4b4776ec 100644--- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java+++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java@@ -376,7 +376,7 @@ public class Config {else if (a instanceof double[]) {double ad[] = (double[]) a;int n = roundNum % ad.length;- sb.append(Format.format(2, (float) ad[n],template));+ sb.append(Format.format(2, ad[n],template));}else {boolean ab[] = (boolean[]) a;diff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.javaindex 7d49aae1f20..e689f6c4102 100644--- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java+++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java@@ -52,6 +52,11 @@ public class Format {return res.substring(res.length() - col.length());}+ public static String format(int numFracDigits, double f, String col) {+ String res = padd + numFormat[numFracDigits].format(f);+ return res.substring(res.length() - col.length());+ }+/*** Padd a number from right.* @param numFracDigits number of digits in fraction part - must be 0 or 1 or 2.@@ -64,6 +69,11 @@ public class Format {return res.substring(0, col.length());}+ public static String formatPaddRight(int numFracDigits, double f, String col) {+ String res = numFormat[numFracDigits].format(f) + padd;+ return res.substring(0, col.length());+ }+/*** Padd a number from left.* @param n number to be formatted.