|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.driver.DriverContext
public abstract class DriverContext
DriverContext is the point of communication between the developer-provided driver and the Faban driver framework. Each thread has it's own context.
The only concrete implementation of this abstract class is in com.sun.faban.driver.engine.DriverContext.
Constructor Summary | |
---|---|
DriverContext()
|
Method Summary | |
---|---|
abstract void |
attachMetrics(CustomMetrics metrics)
Attaches a custom metrics object to the primary metrics. |
abstract void |
attachMetrics(String name,
CustomMetrics metrics)
Attaches a custom metrics object to the primary metrics, given a name or description. |
abstract void |
attachMetrics(String name,
CustomTableMetrics metrics)
Attaches a custom table metrics object to the primary metrics, given a name or description. |
abstract int |
getAgentId()
Obtains the agent id for this agent. |
abstract String |
getBaseDir()
Obtains the base directory where the benchmark currently being run is installed. |
abstract int |
getClientsInAgent()
Obtains the number of client threads in this agent. |
abstract int |
getClientsInDriver()
Obtains the total number of clients threads for this driver. |
static DriverContext |
getContext()
Obtains the DriverContext associated with this thread. |
abstract String |
getCurrentOperation()
Obtains the name of the operation currently executing. |
abstract String |
getDriverName()
Obtains the driver's name as annotated in the driver class. |
abstract Logger |
getLogger()
Obtains the logger to be used by the calling driver. |
abstract long |
getNanoTime()
Obtains a relative time, in nanosecs. |
abstract int |
getOperationCount()
Obtains the number of operations active in this driver. |
abstract int |
getOperationId()
Obtains the unique id assigned to the current operation type. |
abstract Element |
getPropertiesNode()
Obtains the reference to the whole properties element as configured in the driverConfig element of this driver in the config file. |
abstract String |
getProperty(String name)
Obtains a single-value property from the configuration. |
abstract String[] |
getPropertyValues(String name)
Obtains a multiple-value property from the configuration. |
abstract int |
getRampDown()
Obtains the configured ramp down time. |
abstract int |
getRampUp()
Obtains the configured ramp up time. |
abstract Random |
getRandom()
Obtains the per-thread random value generator. |
abstract String |
getResourceDir()
Obtains the resource directory used for this benchmark, if exists. |
abstract int |
getScale()
Obtains the scale or scaling rate of the current run. |
abstract int |
getSteadyState()
Obtains the configured steady state time. |
abstract int |
getSteadyStateStart()
Obtains the relative time - in milliseconds - that steady state starts, if set. |
abstract long |
getSteadyStateStartNanos()
Obtains the relative time - in nanosecs - that steady state starts, if set. |
abstract int |
getThreadId()
Obtains the global agent thread id for this context's thread. |
abstract int |
getTime()
Obtains a relative time, in milliseconds. |
abstract String |
getXPathValue(String xPath)
Reads the element or attribute by it's XPath. |
abstract boolean |
isTxSteadyState()
Checks whether the driver is currently in steady state or not. |
abstract void |
pauseTime()
Pauses the critical section so that operations made during the pause do not count into the response time. |
abstract void |
recordTime()
Records the start time and end of the critical section of an operation. |
abstract void |
resetMix()
Resets the state of the current mix to start off at the beginning of the mix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DriverContext()
Method Detail |
---|
public static DriverContext getContext()
public abstract int getScale()
public abstract int getClientsInAgent()
public abstract int getClientsInDriver()
public abstract int getThreadId()
public abstract int getAgentId()
public abstract String getDriverName()
public abstract Logger getLogger()
public abstract void attachMetrics(CustomMetrics metrics)
metrics
- The custom metrics to be replacedpublic abstract void attachMetrics(String name, CustomMetrics metrics)
name
- The name or description of this metricsmetrics
- The custom metrics to be replacedpublic abstract void attachMetrics(String name, CustomTableMetrics metrics)
name
- The name or description of this metricsmetrics
- The custom table metrics to be replacedpublic abstract String getCurrentOperation()
public abstract int getOperationId()
public abstract int getOperationCount()
public abstract Random getRandom()
public abstract boolean isTxSteadyState()
public abstract void resetMix()
public abstract void recordTime()
IllegalStateException
- if the operation uses auto timingpublic abstract void pauseTime()
public abstract int getTime()
public abstract int getSteadyStateStart()
public abstract long getNanoTime()
public abstract long getSteadyStateStartNanos()
public abstract int getRampUp()
public abstract int getSteadyState()
public abstract int getRampDown()
public abstract String getProperty(String name)
name
- The property name
public abstract String[] getPropertyValues(String name)
name
- The property name
public abstract Element getPropertiesNode()
public abstract String getXPathValue(String xPath) throws XPathExpressionException
xPath
- The XPath to evaluate.
XPathExpressionException
- If the given XPath has an errorpublic abstract String getBaseDir()
public abstract String getResourceDir()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |