|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.benchmark.byTask.tasks.PerfTask
public abstract class PerfTask
An abstract task to be tested for performance.
Every performance task extends this class, and provides its own
doLogic()
method, which performs the actual task.
Tasks performing some work that should be measured for the task, can override
setup()
and/or tearDown()
and place that work there.
Relevant properties: task.max.depth.log
.
Also supports the following logging attributes:
doLogic()
invocations. Set to -1 to disable
logging.
AddDocTask
, but not for DeleteDocTask
. It's a way to control
per task logging settings. If you want to omit logging for any other task,
include log.step=-1. The syntax is "log.step." together with the Task's
'short' name (i.e., without the 'Task' part).
Field Summary | |
---|---|
protected int |
logStep
|
protected static String |
NEW_LINE
|
protected String |
params
|
protected boolean |
stopNow
|
Constructor Summary | |
---|---|
PerfTask(PerfRunData runData)
|
Method Summary | |
---|---|
protected Object |
clone()
|
void |
close()
|
abstract int |
doLogic()
Perform the task once (ignoring repetitions specification) Return number of work items done by this task. |
int |
getBackgroundDeltaPriority()
|
int |
getDepth()
|
protected String |
getLogMessage(int recsCount)
|
String |
getName()
|
String |
getParams()
|
PerfRunData |
getRunData()
|
boolean |
getRunInBackground()
|
boolean |
isDisableCounting()
Return true if counting is disabled for this task. |
int |
runAndMaybeStats(boolean reportStats)
Run the task, record statistics. |
void |
setDepth(int depth)
|
void |
setDisableCounting(boolean disableCounting)
See isDisableCounting() |
protected void |
setName(String name)
|
void |
setParams(String params)
Set the params of this task. |
void |
setRunInBackground(int deltaPri)
|
void |
setup()
Task setup work that should not be measured for that specific task. |
protected boolean |
shouldNeverLogAtStart()
Tasks that should never log at start can override this. |
protected boolean |
shouldNotRecordStats()
Tasks that should not record statistics can override this. |
void |
stopNow()
|
boolean |
supportsParams()
Sub classes that support parameters must override this method to return true. |
void |
tearDown()
Task tearDown work that should not be measured for that specific task. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int logStep
protected String params
protected static final String NEW_LINE
protected volatile boolean stopNow
Constructor Detail |
---|
public PerfTask(PerfRunData runData)
Method Detail |
---|
public void setRunInBackground(int deltaPri)
public boolean getRunInBackground()
public int getBackgroundDeltaPriority()
public void stopNow()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void close() throws Exception
Exception
public final int runAndMaybeStats(boolean reportStats) throws Exception
Exception
public abstract int doLogic() throws Exception
Exception
public String getName()
protected void setName(String name)
name
- The name to set.public PerfRunData getRunData()
public int getDepth()
public void setDepth(int depth)
depth
- The depth to set.public String toString()
toString
in class Object
protected String getLogMessage(int recsCount)
protected boolean shouldNeverLogAtStart()
protected boolean shouldNotRecordStats()
public void setup() throws Exception
doLogic()
to this method. Only the work done in doLogic()
is measured for this task. Notice that higher level (sequence) tasks
containing this task would then measure larger time than the sum of their
contained tasks.
Exception
public void tearDown() throws Exception
doLogic()
to this method. Only the work done in doLogic()
is measured for this task. Notice that higher level (sequence) tasks
containing this task would then measure larger time than the sum of their
contained tasks.
Exception
public boolean supportsParams()
public void setParams(String params)
UnsupportedOperationException
- for tasks supporting command line parameters.public String getParams()
public boolean isDisableCounting()
public void setDisableCounting(boolean disableCounting)
isDisableCounting()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |