mirror of https://github.com/apache/lucene.git
contrib/benchmark: better error handling and javadocs around "exhaustive" doc making.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@528617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
866b626f67
commit
934a56e55f
|
@ -4,6 +4,10 @@ The Benchmark contrib package contains code for benchmarking Lucene in a variety
|
||||||
|
|
||||||
$Id:$
|
$Id:$
|
||||||
|
|
||||||
|
4/13/07
|
||||||
|
|
||||||
|
Better error handling and javadocs around "exhaustive" doc making.
|
||||||
|
|
||||||
3/25/07
|
3/25/07
|
||||||
|
|
||||||
LUCENE-849:
|
LUCENE-849:
|
||||||
|
|
|
@ -212,11 +212,12 @@ The following is an informal description of the supported syntax.
|
||||||
<br>Example - <font color="#FF0066">{ AddDoc AddDoc } : 30</font> - would do
|
<br>Example - <font color="#FF0066">{ AddDoc AddDoc } : 30</font> - would do
|
||||||
addDoc 60 times in a row.
|
addDoc 60 times in a row.
|
||||||
<br><b>Exhaustive repeating</b>: use <font color="#FF0066">*</font> instead of
|
<br><b>Exhaustive repeating</b>: use <font color="#FF0066">*</font> instead of
|
||||||
a number to repeat forever.
|
a number to repeat exhaustively.
|
||||||
This is sometimes useful, for adding as many files as a doc maker can create,
|
This is sometimes useful, for adding as many files as a doc maker can create,
|
||||||
without iterating over the same files again, but in the case that the exact
|
without iterating over the same file again, especially when the exact
|
||||||
number of files is not known in advance. For insance, TREC files extracted
|
number of documents is not known in advance. For insance, TREC files extracted
|
||||||
from a zip file.
|
from a zip file. Note: when using this, you must also set
|
||||||
|
<font color="#FF0066">doc.maker.forever</font> to false.
|
||||||
<br>Example - <font color="#FF0066">{ AddDoc } : *</font> - would add docs
|
<br>Example - <font color="#FF0066">{ AddDoc } : *</font> - would add docs
|
||||||
until the doc maker is "exhausted".
|
until the doc maker is "exhausted".
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -67,8 +67,13 @@ public class TaskSequence extends PerfTask {
|
||||||
*/
|
*/
|
||||||
public void setRepetitions(int repetitions) throws Exception {
|
public void setRepetitions(int repetitions) throws Exception {
|
||||||
this.repetitions = repetitions;
|
this.repetitions = repetitions;
|
||||||
if (repetitions==REPEAT_EXHAUST && isParallel()) {
|
if (repetitions==REPEAT_EXHAUST) {
|
||||||
throw new Exception("REPEAT_EXHAUST is not allowed for parallel tasks");
|
if (isParallel()) {
|
||||||
|
throw new Exception("REPEAT_EXHAUST is not allowed for parallel tasks");
|
||||||
|
}
|
||||||
|
if (getRunData().getConfig().get("doc.maker.forever",true)) {
|
||||||
|
throw new Exception("REPEAT_EXHAUST requires setting doc.maker.forever=false");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setSequenceName();
|
setSequenceName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,9 +195,11 @@ public class Config {
|
||||||
public int newRound () {
|
public int newRound () {
|
||||||
roundNumber++;
|
roundNumber++;
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer("--> Round ").append(roundNumber-1).append("-->").append(roundNumber);
|
||||||
|
|
||||||
// log changes in values
|
// log changes in values
|
||||||
if (valByRound.size()>0) {
|
if (valByRound.size()>0) {
|
||||||
StringBuffer sb = new StringBuffer("--> Round ").append(roundNumber-1).append("-->").append(roundNumber).append(": ");
|
sb.append(": ");
|
||||||
for (Iterator iter = valByRound.keySet().iterator(); iter.hasNext();) {
|
for (Iterator iter = valByRound.keySet().iterator(); iter.hasNext();) {
|
||||||
String name = (String) iter.next();
|
String name = (String) iter.next();
|
||||||
Object a = valByRound.get(name);
|
Object a = valByRound.get(name);
|
||||||
|
@ -213,10 +215,11 @@ public class Config {
|
||||||
sb.append(" ").append(name).append(":").append(ab[n1]).append("-->").append(ab[n2]);
|
sb.append(" ").append(name).append(":").append(ab[n1]).append("-->").append(ab[n2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println();
|
|
||||||
System.out.println(sb.toString());
|
|
||||||
System.out.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
System.out.println(sb.toString());
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
return roundNumber;
|
return roundNumber;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue