public abstract class PerfTask
extends java.lang.Object
implements java.lang.Cloneable
doLogic()
method, which performs the actual task. setup()
and/or tearDown()
and place that work there. task.max.depth.log
.doLogic()
invocations. Set to -1 to disable
logging.
AddDocTask
. 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).
Modifier and Type | Field and Description |
---|---|
protected int |
logStep |
protected static java.lang.String |
NEW_LINE |
protected java.lang.String |
params |
protected boolean |
stopNow |
Constructor and Description |
---|
PerfTask(PerfRunData runData) |
Modifier and Type | Method and Description |
---|---|
protected PerfTask |
clone() |
void |
close() |
abstract int |
doLogic()
Perform the task once (ignoring repetitions specification)
Return number of work items done by this task.
|
int |
getAlgLineNum() |
int |
getBackgroundDeltaPriority() |
int |
getDepth() |
protected java.lang.String |
getLogMessage(int recsCount) |
java.lang.String |
getName() |
java.lang.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 |
setAlgLineNum(int algLineNum) |
void |
setDepth(int depth) |
void |
setDisableCounting(boolean disableCounting)
|
protected void |
setName(java.lang.String name) |
void |
setParams(java.lang.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.
|
java.lang.String |
toString() |
protected int logStep
protected java.lang.String params
protected static final java.lang.String NEW_LINE
protected volatile boolean stopNow
public PerfTask(PerfRunData runData)
public void setRunInBackground(int deltaPri)
public boolean getRunInBackground()
public int getBackgroundDeltaPriority()
public void stopNow()
protected PerfTask clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void close() throws java.lang.Exception
java.lang.Exception
public final int runAndMaybeStats(boolean reportStats) throws java.lang.Exception
java.lang.Exception
public abstract int doLogic() throws java.lang.Exception
java.lang.Exception
public java.lang.String getName()
protected void setName(java.lang.String name)
name
- The name to set.public PerfRunData getRunData()
public int getDepth()
public void setDepth(int depth)
depth
- The depth to set.public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getLogMessage(int recsCount)
protected boolean shouldNeverLogAtStart()
protected boolean shouldNotRecordStats()
public void setup() throws java.lang.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.java.lang.Exception
public void tearDown() throws java.lang.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.java.lang.Exception
public boolean supportsParams()
public void setParams(java.lang.String params)
java.lang.UnsupportedOperationException
- for tasks supporting command line parameters.public java.lang.String getParams()
public boolean isDisableCounting()
public void setDisableCounting(boolean disableCounting)
public void setAlgLineNum(int algLineNum)
public int getAlgLineNum()
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.