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