|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.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 DriverContextpublic int getClientsInAgent()
getClientsInAgent in class DriverContextpublic int getClientsInDriver()
getClientsInDriver in class DriverContextpublic int getThreadId()
getThreadId in class DriverContextpublic int getAgentId()
getAgentId in class DriverContextpublic String getDriverName()
getDriverName in class DriverContextpublic Logger getLogger()
getLogger in class DriverContextpublic String getCurrentOperation()
getCurrentOperation in class DriverContextpublic int getOperationId()
getOperationId in class DriverContextpublic int getOperationCount()
getOperationCount in class DriverContextpublic Random getRandom()
getRandom in class DriverContextpublic void resetMix()
resetMix in class DriverContextpublic void attachMetrics(CustomMetrics metrics)
attachMetrics in class DriverContextmetrics - The custom metrics to be replaced
public void attachMetrics(String name,
CustomMetrics metrics)
attachMetrics in class DriverContextname - The name or description of this metricsmetrics - The custom metrics to be replaced
public void attachMetrics(String name,
CustomTableMetrics metrics)
attachMetrics in class DriverContextname - The name or description of this metricsmetrics - The custom metrics to be replacedpublic String getProperty(String name)
getProperty in class DriverContextname - The property name
public String[] getPropertyValues(String name)
getPropertyValues in class DriverContextname - The property name
public Element getPropertiesNode()
getPropertiesNode in class DriverContextpublic boolean isTxSteadyState()
isTxSteadyState in class DriverContext
public String getXPathValue(String xPath)
throws XPathExpressionException
getXPathValue in class DriverContextxPath - The XPath to evaluate.
XPathExpressionException - If the given XPath has an errorpublic void recordTime()
recordTime in class DriverContextIllegalStateException - if the operation uses auto timingpublic void pauseTime()
pauseTime in class DriverContextpublic int getTime()
getTime in class DriverContextpublic int getSteadyStateStart()
getSteadyStateStart in class DriverContextpublic long getNanoTime()
getNanoTime in class DriverContextpublic long getSteadyStateStartNanos()
getSteadyStateStartNanos in class DriverContextpublic int getRampUp()
getRampUp in class DriverContextpublic int getSteadyState()
getSteadyState in class DriverContextpublic int getRampDown()
getRampDown in class DriverContextpublic 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 DriverContextpublic String getResourceDir()
getResourceDir in class DriverContext
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||