Package com.xceptance.xlt.api.engine
Interface Data
-
- All Known Implementing Classes:
AbstractData,ActionData,CustomData,CustomValue,EventData,PageLoadTimingData,RequestData,TimerData,TransactionData
public interface DataThe
Datainterface defines the minimum functionality any data record must implement to be recordable by the XLT engine. Typically, the XLT engine already collects sufficient data (e.g. error and run time values). However, it may be necessary to log other important values as well. For this, a new data record type needs to be created, either by implementing this interface or - preferably - by extending from one of the already existing data record types.Such a data record class must obey the following rules:
- it must have a name
- it must have a time stamp
- it must be serializable to a comma-separated list of values
- it must be able to reconstruct its state from a comma-separated list of values
- in order to tell one type of data record from the other, the first entry in the value list must be a type code (e.g. "MyRecordType" or simple "M")
Note that the type codes "A", "C", "E", "J", "R", and "T" are already used by the XLT engine.
The data record can be logged using the
DataManager.
-
-
Field Summary
Fields Modifier and Type Field Description static charDELIMITERThe delimiter character (a comma) used to separate single values in a data record.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbaseValuesFromCSV(SimpleArrayList<XltCharBuffer> result, XltCharBuffer src)Recreates a partial state of this object by reading the data from a buffer s and parsing it as comma-delimited line.java.lang.StringgetAgentName()Returns the name of the agent that produced this data record.java.lang.StringgetName()Returns the name of this data record.longgetTime()Returns the time when the event occurred that this data record was created for.java.lang.StringgetTransactionName()Returns the name of the transaction that produced this data record.chargetTypeCode()Returns the type code of this data record.voidremainingValuesFromCSV(SimpleArrayList<XltCharBuffer> result)Recreates the full state of the object by parsing the remaining data of the passed list.voidsetAgentName(java.lang.String agentName)Sets the name of the agent that produced this data record.voidsetName(java.lang.String name)Sets the name of this data record.voidsetTime(long time)Sets the time when this record's event occurred.voidsetTransactionName(java.lang.String transactionName)Sets the name of the transaction that produced this data record.java.lang.StringBuildertoCSV()Returns the state of this object as a StringBuilder reflecting a list of values separated by the DELIMITER constant.
-
-
-
Field Detail
-
DELIMITER
static final char DELIMITER
The delimiter character (a comma) used to separate single values in a data record.- See Also:
- Constant Field Values
-
-
Method Detail
-
baseValuesFromCSV
void baseValuesFromCSV(SimpleArrayList<XltCharBuffer> result, XltCharBuffer src)
Recreates a partial state of this object by reading the data from a buffer s and parsing it as comma-delimited line. The result is an empty reusable object that is here for speed not functionality. The data will be internally stored and only the most essential state will be recreated first, because later we might filter things out anyway, so why waste cycles. The passed list must be empty and it will be mutated to hold the full parse result.- Parameters:
result- reusable list for the parsing resultssrc- the csv data as charbuffer
-
remainingValuesFromCSV
void remainingValuesFromCSV(SimpleArrayList<XltCharBuffer> result)
Recreates the full state of the object by parsing the remaining data of the passed list. It is the programmers responsibility to make sure that the result list matches the one initially created when calling baseValuesFromCSV. This is an implementation focusing on speed not a nice API aka you can reuse a list over and over again as long as the calling order is right.- Parameters:
result- the previously parsed data as list
-
getAgentName
java.lang.String getAgentName()
Returns the name of the agent that produced this data record. Only used during report generation or analysis.- Returns:
- the agent's name
-
getName
java.lang.String getName()
Returns the name of this data record.- Returns:
- the name
-
getTime
long getTime()
Returns the time when the event occurred that this data record was created for.- Returns:
- the time
-
getTransactionName
java.lang.String getTransactionName()
Returns the name of the transaction that produced this data record. Only used during report generation or analysis.- Returns:
- the transaction's name
-
getTypeCode
char getTypeCode()
Returns the type code of this data record.- Returns:
- the type code
-
setAgentName
void setAgentName(java.lang.String agentName)
Sets the name of the agent that produced this data record. Only used during report generation or analysis.- Parameters:
agentName- the agent's name
-
setName
void setName(java.lang.String name)
Sets the name of this data record.- Parameters:
name- the name
-
setTime
void setTime(long time)
Sets the time when this record's event occurred. To obtain the timestamp, please useGlobalClock.millis().- Parameters:
time- the timestamp
-
setTransactionName
void setTransactionName(java.lang.String transactionName)
Sets the name of the transaction that produced this data record. Only used during report generation or analysis.- Parameters:
transactionName- the transaction's name
-
toCSV
java.lang.StringBuilder toCSV()
Returns the state of this object as a StringBuilder reflecting a list of values separated by the DELIMITER constant.- Returns:
- the list of values as CSV line
-
-