Package com.xceptance.xlt.api.engine
Class TimerData
- java.lang.Object
-
- com.xceptance.xlt.api.engine.AbstractData
-
- com.xceptance.xlt.api.engine.TimerData
-
- All Implemented Interfaces:
Data
- Direct Known Subclasses:
ActionData,CustomData,PageLoadTimingData,RequestData,TransactionData
public abstract class TimerData extends AbstractData
TheTimerDataclass is the super class for all timer-based data records.
-
-
Constructor Summary
Constructors Constructor Description TimerData(java.lang.String typeCode)Creates a newTimerDataobject and gives it the specified type code.TimerData(java.lang.String name, java.lang.String typeCode)Creates a newTimerDataobject and gives it the specified name and type code.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<java.lang.String>addValues()Builds a list of string values that represents the state of this object.longgetEndTime()Returns the end time.protected intgetMinNoCSVElements()Returns the minimum number of elements in the CSV string.longgetRunTime()Returns the run time.booleanhasFailed()Indicates whether or not a failure had occurred.protected voidparseValues(java.lang.String[] values)Recreates the state of this object from an array of string values.voidsetFailed(boolean failed)Sets whether or not a failure had occurred.voidsetRunTime()Sets the run time to be the difference between the current time and the current value of the start time attribute.voidsetRunTime(long runTime)Sets the run time.-
Methods inherited from class com.xceptance.xlt.api.engine.AbstractData
fromCSV, getAgentName, getName, getTime, getTransactionName, getTypeCode, setAgentName, setName, setTime, setTime, setTransactionName, toCSV
-
-
-
-
Constructor Detail
-
TimerData
public TimerData(java.lang.String typeCode)
Creates a newTimerDataobject and gives it the specified type code.- Parameters:
typeCode- the type code
-
TimerData
public TimerData(java.lang.String name, java.lang.String typeCode)Creates a newTimerDataobject and gives it the specified name and type code. Furthermore, the start time attribute is set to the current time.- Parameters:
name- the request nametypeCode- the type code
-
-
Method Detail
-
getEndTime
public long getEndTime()
Returns the end time. Calculated from start time and run time.- Returns:
- the end time
-
getRunTime
public long getRunTime()
Returns the run time.- Returns:
- the run time
-
hasFailed
public boolean hasFailed()
Indicates whether or not a failure had occurred.- Returns:
- the failure status
-
setFailed
public void setFailed(boolean failed)
Sets whether or not a failure had occurred.- Parameters:
failed- the new status
-
setRunTime
public void setRunTime()
Sets the run time to be the difference between the current time and the current value of the start time attribute.
-
setRunTime
public void setRunTime(long runTime)
Sets the run time.- Parameters:
runTime- the runTime
-
addValues
protected java.util.List<java.lang.String> addValues()
Builds a list of string values that represents the state of this object. Override this method in sub classes to add custom values and use the list created by the super class.- Overrides:
addValuesin classAbstractData- Returns:
- the list of values
-
parseValues
protected void parseValues(java.lang.String[] values)
Recreates the state of this object from an array of string values. Override this method in sub classes to restore custom values, but do not forget to call the super class first.- Overrides:
parseValuesin classAbstractData- Parameters:
values- the list of values, must have at least the lengthAbstractData.getMinNoCSVElements()
-
getMinNoCSVElements
protected int getMinNoCSVElements()
Returns the minimum number of elements in the CSV string.- Overrides:
getMinNoCSVElementsin classAbstractData- Returns:
- minimum number of elements in the CSV string
-
-