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
The RequestData
class 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 RequestData
objects have an "R" as their type code.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final XltCharBuffer
The value to show if the host could not be determined from a URL. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RequestData object.RequestData
(String name) Creates a new RequestData object and gives it the specified name. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the size of the response message.int
Returns the size of the request message.int
Returns the time it took to connect to the server.Returns the response's content type.int
Returns the time it took to look up the IP address for a host name.Returns the form data.Returns the encoding of the form data.getHost()
Returns the host parsed from the url or UNKNOWN_HOST if it does not exist.Returns the HTTP method of the request.String[]
Returns the list of IP addresses reported by DNS for the host name used when making the request.int
Returns the time it took to receive the response from the server.Returns the request ID that was sent to the server.int
Returns the request's response code.Returns the response ID that was sent back by the server.int
Returns the time it took to send the request to the server.int
Returns the time it took the server the process the request.int
Returns the time until the first response bytes arrived, including connect time and server busy time.int
Returns the time needed to read all response bytes, including connect time and server busy time.getUrl()
Returns the request's URL.Returns the target IP address of the system under test that was used when making the request.int
Returns the hashcode of the fragment free version of the urlvoid
setBytesReceived
(int responseSize) Sets the size of the response messagevoid
setBytesSent
(int requestSize) Sets the size of the request messagevoid
setConnectTime
(int connectTime) Sets The time it took to connect to the server.void
setContentType
(XltCharBuffer contentType) Sets the response's content type.void
setContentType
(String contentType) Sets the response's content type.void
setDnsTime
(int dnsTime) Sets the time it took to look up the IP address for a host name.void
setFormData
(XltCharBuffer formData) Set the form data.void
setFormData
(String formData) Set the form data.void
setFormDataEncoding
(XltCharBuffer encoding) Set the form data encoding.void
setFormDataEncoding
(String encoding) Set the form data encoding.void
setHttpMethod
(XltCharBuffer httpMethod) Set the httpMethod valuevoid
setHttpMethod
(String httpMethod) Set the httpMethod valuevoid
setIpAddresses
(String[] ipAddresses) Sets the list of IP addresses reported by DNS for the host name used when making the request.void
setReceiveTime
(int receiveTime) Sets the time it took to receive the response from the server.void
setRemainingValues
(List<XltCharBuffer> values) Called by XLT during report creation to recreate the remaining object state from the passed string list.void
Sets the request ID that was sent to the server.void
setRequestId
(String id) Sets the request ID that was sent to the server.void
setResponseCode
(int responseCode) Sets the request's response code.void
Sets the response ID that was sent back by the server.void
setResponseId
(String id) Sets the response ID that was sent back by the server.void
setSendTime
(int sendTime) Sets the time it took to send the request to the server.void
setServerBusyTime
(int serverBusyTime) Sets the time it took the server the process the request.void
setTimeToFirstBytes
(int timeToFirstBytes) Set the timeToFirstBytes attributevoid
setTimeToLastBytes
(int timeToLastBytes) Set the timeToLastBytes attributevoid
setUrl
(XltCharBuffer url) Sets the request's URL.void
Sets the request's URL.void
setUsedIpAddress
(XltCharBuffer ipAddress) Sets the target IP address of the system under test that was used when making the request.void
setUsedIpAddress
(String ipAddress) Sets the target IP address of the system under test that was used when making the request.toList()
Called by XLT during a load test to return the full state of the object as a list of strings.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
getAgentName, getName, getTime, getTransactionName, getTypeCode, setAgentName, setAllValues, setBaseValues, setName, setTime, setTransactionName
-
Field Details
-
UNKNOWN_HOST
The value to show if the host could not be determined from a URL.
-
-
Constructor Details
-
RequestData
public RequestData()Creates a new RequestData object. -
RequestData
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 Details
-
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
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
Returns the request ID that was sent to the server.- Returns:
- the request ID
-
getResponseId
Returns the response ID that was sent back by the server.- Returns:
- the response ID
-
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
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
Returns the HTTP method of the request.- Returns:
- the HTTP method.
-
getFormDataEncoding
Returns the encoding of the form data.- Returns:
- the data encoding.
-
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
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
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
Sets the response's content type.- Parameters:
contentType
- the contentType
-
setContentType
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
Sets the request ID that was sent to the server.- Parameters:
id
- the request ID
-
setRequestId
Sets the request ID that was sent to the server.- Parameters:
id
- the request ID
-
setResponseId
Sets the response ID that was sent back by the server.- Parameters:
id
- the response ID
-
setResponseId
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
Sets the request's URL. This is for encoding!- Parameters:
url
- the URL
-
setUrl
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
Set the httpMethod value- Parameters:
httpMethod
- the new httpMethod value
-
setHttpMethod
Set the httpMethod value- Parameters:
httpMethod
- the new httpMethod value
-
setFormDataEncoding
Set the form data encoding.- Parameters:
encoding
- the new encoding
-
setFormDataEncoding
Set the form data encoding.- Parameters:
encoding
- the new encoding
-
setFormData
Set the form data.- Parameters:
formData
- the new data
-
setFormData
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
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
Sets the target IP address of the system under test that was used when making the request.- Parameters:
ipAddress
- the used IP address
-
setUsedIpAddress
Sets the target IP address of the system under test that was used when making the request.- Parameters:
ipAddress
- the used IP address
-
toList
Called by XLT during a load test to return the full state of the object as a list of strings. The first three entries have to be, in this order, the type code, the name, and the timestamp. All remaining entries and their order are specific to the concrete implementation class.Override this method in sub classes by calling the super method and adding custom values to the list it returns.
-
setRemainingValues
Called by XLT during report creation to recreate the remaining object state from the passed string list. The base values have already been initialized by callingData.setBaseValues(List)
with the same list of values. Splitting the process of recreating the full object state into two methods is purely for performance reasons as the second step is not always needed.- Specified by:
setRemainingValues
in interfaceData
- Overrides:
setRemainingValues
in classTimerData
- Parameters:
values
- the string list to recreate the object state from- See Also:
-