Package com.xceptance.xlt.api.engine
Class RequestData
- java.lang.Object
-
- com.xceptance.xlt.api.engine.AbstractData
-
- com.xceptance.xlt.api.engine.TimerData
-
- com.xceptance.xlt.api.engine.RequestData
-
- All Implemented Interfaces:
Data
public class RequestData extends TimerData
The
RequestDataclass holds any data measured for a request. Typically, a request represents one call to a (remote) server.The values stored include not only the request's start and run time, but also an indicator whether or not the request was executed successfully. Data gathered for the same type of request may be correlated via the name attribute.
Note that
RequestDataobjects have an "R" as their type code.- See Also:
ActionData,TransactionData,CustomData,EventData
-
-
Field Summary
Fields Modifier and Type Field Description static XltCharBufferUNKNOWN_HOSTThe value to show if the host could not be determined from a URL.
-
Constructor Summary
Constructors Constructor Description RequestData()Creates a new RequestData object.RequestData(java.lang.String name)Creates a new RequestData object and gives it the specified name.
-
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.intgetBytesReceived()Returns the size of the response message.intgetBytesSent()Returns the size of the request message.intgetConnectTime()Returns the time it took to connect to the server.XltCharBuffergetContentType()Returns the response's content type.intgetDnsTime()Returns the time it took to look up the IP address for a host name.XltCharBuffergetFormData()Returns the form data.XltCharBuffergetFormDataEncoding()Returns the encoding of the form data.XltCharBuffergetHost()Returns the host parsed from the url or UNKNOWN_HOST if it does not exist.XltCharBuffergetHttpMethod()Returns the HTTP method of the request.java.lang.String[]getIpAddresses()Returns the list of IP addresses reported by DNS for the host name used when making the request.protected intgetMinNoCSVElements()Returns the minimum number of elements in the CSV string.intgetReceiveTime()Returns the time it took to receive the response from the server.java.lang.StringgetRequestId()Returns the request ID that was sent to the server.intgetResponseCode()Returns the request's response code.java.lang.StringgetResponseId()Returns the response ID that was sent back by the server.intgetSendTime()Returns the time it took to send the request to the server.intgetServerBusyTime()Returns the time it took the server the process the request.intgetTimeToFirstBytes()Returns the time until the first response bytes arrived, including connect time and server busy time.intgetTimeToLastBytes()Returns the time needed to read all response bytes, including connect time and server busy time.XltCharBuffergetUrl()Returns the request's URL.XltCharBuffergetUsedIpAddress()Returns the target IP address of the system under test that was used when making the request.inthashCodeOfUrlWithoutFragment()Returns the hashcode of the fragment free version of the urlprotected voidparseRemainingValues(java.util.List<XltCharBuffer> values)Recreates the state of this object from an array of values.voidsetBytesReceived(int responseSize)Sets the size of the response messagevoidsetBytesSent(int requestSize)Sets the size of the request messagevoidsetConnectTime(int connectTime)Sets The time it took to connect to the server.voidsetContentType(XltCharBuffer contentType)Sets the response's content type.voidsetContentType(java.lang.String contentType)Sets the response's content type.voidsetDnsTime(int dnsTime)Sets the time it took to look up the IP address for a host name.voidsetFormData(XltCharBuffer formData)Set the form data.voidsetFormData(java.lang.String formData)Set the form data.voidsetFormDataEncoding(XltCharBuffer encoding)Set the form data encoding.voidsetFormDataEncoding(java.lang.String encoding)Set the form data encoding.voidsetHttpMethod(XltCharBuffer httpMethod)Set the httpMethod valuevoidsetHttpMethod(java.lang.String httpMethod)Set the httpMethod valuevoidsetIpAddresses(java.lang.String[] ipAddresses)Sets the list of IP addresses reported by DNS for the host name used when making the request.voidsetReceiveTime(int receiveTime)Sets the time it took to receive the response from the server.voidsetRequestId(XltCharBuffer id)Sets the request ID that was sent to the server.voidsetRequestId(java.lang.String id)Sets the request ID that was sent to the server.voidsetResponseCode(int responseCode)Sets the request's response code.voidsetResponseId(XltCharBuffer id)Sets the response ID that was sent back by the server.voidsetResponseId(java.lang.String id)Sets the response ID that was sent back by the server.voidsetSendTime(int sendTime)Sets the time it took to send the request to the server.voidsetServerBusyTime(int serverBusyTime)Sets the time it took the server the process the request.voidsetTimeToFirstBytes(int timeToFirstBytes)Set the timeToFirstBytes attributevoidsetTimeToLastBytes(int timeToLastBytes)Set the timeToLastBytes attributevoidsetUrl(XltCharBuffer url)Sets the request's URL.voidsetUrl(java.lang.String url)Sets the request's URL.voidsetUsedIpAddress(XltCharBuffer ipAddress)Sets the target IP address of the system under test that was used when making the request.voidsetUsedIpAddress(java.lang.String ipAddress)Sets the target IP address of the system under test that was used when making the request.-
Methods inherited from class com.xceptance.xlt.api.engine.TimerData
getEndTime, getRunTime, hasFailed, setFailed, setRunTime, setRunTime
-
Methods inherited from class com.xceptance.xlt.api.engine.AbstractData
baseValuesFromCSV, getAgentName, getName, getTime, getTransactionName, getTypeCode, parseBaseValues, parseValues, remainingValuesFromCSV, setAgentName, setName, setTime, setTransactionName, toCSV
-
-
-
-
Field Detail
-
UNKNOWN_HOST
public static final XltCharBuffer UNKNOWN_HOST
The value to show if the host could not be determined from a URL.
-
-
Constructor Detail
-
RequestData
public RequestData()
Creates a new RequestData object.
-
RequestData
public RequestData(java.lang.String name)
Creates a new RequestData object and gives it the specified name. Furthermore, the start time attribute is set to the current time.- Parameters:
name- the request name
-
-
Method Detail
-
getBytesReceived
public int getBytesReceived()
Returns the size of the response message.- Returns:
- the bytes received
-
getBytesSent
public int getBytesSent()
Returns the size of the request message.- Returns:
- the bytes sent
-
getConnectTime
public int getConnectTime()
Returns the time it took to connect to the server.- Returns:
- the connect time
-
getContentType
public XltCharBuffer getContentType()
Returns the response's content type.- Returns:
- the content type
-
getReceiveTime
public int getReceiveTime()
Returns the time it took to receive the response from the server.- Returns:
- the receive time
-
getResponseCode
public int getResponseCode()
Returns the request's response code.- Returns:
- the response code
-
getSendTime
public int getSendTime()
Returns the time it took to send the request to the server.- Returns:
- the send time
-
getServerBusyTime
public int getServerBusyTime()
Returns the time it took the server the process the request.- Returns:
- the server busy time
-
getTimeToFirstBytes
public int getTimeToFirstBytes()
Returns the time until the first response bytes arrived, including connect time and server busy time.- Returns:
- the time to first bytes
-
getTimeToLastBytes
public int getTimeToLastBytes()
Returns the time needed to read all response bytes, including connect time and server busy time.- Returns:
- the time to last bytes
-
getRequestId
public java.lang.String getRequestId()
Returns the request ID that was sent to the server.- Returns:
- the request ID
-
getResponseId
public java.lang.String getResponseId()
Returns the response ID that was sent back by the server.- Returns:
- the response ID
-
getUrl
public XltCharBuffer getUrl()
Returns the request's URL.- Returns:
- the URL
-
hashCodeOfUrlWithoutFragment
public int hashCodeOfUrlWithoutFragment()
Returns the hashcode of the fragment free version of the url- Returns:
- the hashcode of the fragment free url
-
getHost
public XltCharBuffer getHost()
Returns the host parsed from the url or UNKNOWN_HOST if it does not exist. Never null or empty.- Returns:
- the host from the url
-
getHttpMethod
public XltCharBuffer getHttpMethod()
Returns the HTTP method of the request.- Returns:
- the HTTP method.
-
getFormDataEncoding
public XltCharBuffer getFormDataEncoding()
Returns the encoding of the form data.- Returns:
- the data encoding.
-
getFormData
public XltCharBuffer getFormData()
Returns the form data.- Returns:
- the form data.
-
getDnsTime
public int getDnsTime()
Returns the time it took to look up the IP address for a host name.- Returns:
- the look-up time
-
getIpAddresses
public java.lang.String[] getIpAddresses()
Returns the list of IP addresses reported by DNS for the host name used when making the request.- Returns:
- the list of IP addresses
-
getUsedIpAddress
public XltCharBuffer getUsedIpAddress()
Returns the target IP address of the system under test that was used when making the request.- Returns:
- the used IP address
-
setBytesReceived
public void setBytesReceived(int responseSize)
Sets the size of the response message- Parameters:
responseSize- the response size
-
setBytesSent
public void setBytesSent(int requestSize)
Sets the size of the request message- Parameters:
requestSize- the request size
-
setConnectTime
public void setConnectTime(int connectTime)
Sets The time it took to connect to the server.- Parameters:
connectTime- the connect time
-
setContentType
public void setContentType(java.lang.String contentType)
Sets the response's content type.- Parameters:
contentType- the contentType
-
setContentType
public void setContentType(XltCharBuffer contentType)
Sets the response's content type.- Parameters:
contentType- the contentType
-
setReceiveTime
public void setReceiveTime(int receiveTime)
Sets the time it took to receive the response from the server.- Parameters:
receiveTime- the receive time
-
setRequestId
public void setRequestId(XltCharBuffer id)
Sets the request ID that was sent to the server.- Parameters:
id- the request ID
-
setRequestId
public void setRequestId(java.lang.String id)
Sets the request ID that was sent to the server.- Parameters:
id- the request ID
-
setResponseId
public void setResponseId(XltCharBuffer id)
Sets the response ID that was sent back by the server.- Parameters:
id- the response ID
-
setResponseId
public void setResponseId(java.lang.String id)
Sets the response ID that was sent back by the server.- Parameters:
id- the response ID
-
setResponseCode
public void setResponseCode(int responseCode)
Sets the request's response code.- Parameters:
responseCode- the response code
-
setSendTime
public void setSendTime(int sendTime)
Sets the time it took to send the request to the server.- Parameters:
sendTime- the send time
-
setServerBusyTime
public void setServerBusyTime(int serverBusyTime)
Sets the time it took the server the process the request.- Parameters:
serverBusyTime- the server busy time
-
setTimeToFirstBytes
public void setTimeToFirstBytes(int timeToFirstBytes)
Set the timeToFirstBytes attribute- Parameters:
timeToFirstBytes- the new timeToFirstBytes value
-
setTimeToLastBytes
public void setTimeToLastBytes(int timeToLastBytes)
Set the timeToLastBytes attribute- Parameters:
timeToLastBytes- the new timeToLastBytes value
-
setUrl
public void setUrl(java.lang.String url)
Sets the request's URL. This is for encoding!- Parameters:
url- the URL
-
setUrl
public void setUrl(XltCharBuffer url)
Sets the request's URL. Uses a char buffer for efficiency. This is for decoding. We do it here because it is more efficient because the data is hotter and we have more cpu available than later in the providers.- Parameters:
url- the URL
-
setHttpMethod
public void setHttpMethod(XltCharBuffer httpMethod)
Set the httpMethod value- Parameters:
httpMethod- the new httpMethod value
-
setHttpMethod
public void setHttpMethod(java.lang.String httpMethod)
Set the httpMethod value- Parameters:
httpMethod- the new httpMethod value
-
setFormDataEncoding
public void setFormDataEncoding(XltCharBuffer encoding)
Set the form data encoding.- Parameters:
encoding- the new encoding
-
setFormDataEncoding
public void setFormDataEncoding(java.lang.String encoding)
Set the form data encoding.- Parameters:
encoding- the new encoding
-
setFormData
public void setFormData(XltCharBuffer formData)
Set the form data.- Parameters:
formData- the new data
-
setFormData
public void setFormData(java.lang.String formData)
Set the form data.- Parameters:
formData- the new data
-
setDnsTime
public void setDnsTime(int dnsTime)
Sets the time it took to look up the IP address for a host name.- Parameters:
dnsTime- the look-up time
-
setIpAddresses
public void setIpAddresses(java.lang.String[] ipAddresses)
Sets the list of IP addresses reported by DNS for the host name used when making the request.- Parameters:
ipAddresses- the list of IP addresses
-
setUsedIpAddress
public void setUsedIpAddress(XltCharBuffer ipAddress)
Sets the target IP address of the system under test that was used when making the request.- Parameters:
ipAddress- the used IP address
-
setUsedIpAddress
public void setUsedIpAddress(java.lang.String ipAddress)
Sets the target IP address of the system under test that was used when making the request.- Parameters:
ipAddress- the used IP address
-
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.
-
getMinNoCSVElements
protected int getMinNoCSVElements()
Returns the minimum number of elements in the CSV string.- Overrides:
getMinNoCSVElementsin classTimerData- Returns:
- minimum number of elements in the CSV string
-
parseRemainingValues
protected void parseRemainingValues(java.util.List<XltCharBuffer> values)
Recreates the state of this object from an array of values. Override this method in sub classes to restore custom values.- Overrides:
parseRemainingValuesin classTimerData- Parameters:
values- the list of values, must have at least the lengthAbstractData.getMinNoCSVElements()
-
-