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 XltCharBufferNo response code availablestatic final XltCharBufferThe 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 TypeMethodDescriptionintReturns the size of the response message.intReturns the size of the request message.intReturns the time it took to connect to the server.Returns the response's content type.intReturns 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.Returns the request's original URL.intReturns the time it took to receive the response from the server.Returns the request ID that was sent to the server.intReturns the request's response code.Get the request's response code as originally recorded.Returns the response ID that was sent back by the server.intReturns the time it took to send the request to the server.intReturns the time it took the server the process the request.intReturns the time until the first response bytes arrived, including connect time and server busy time.intReturns 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.intReturns the hashcode of the fragment free version of the urlvoidsetBytesReceived(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(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(String formData) Set the form data.voidsetFormDataEncoding(XltCharBuffer encoding) Set the form data encoding.voidsetFormDataEncoding(String encoding) Set the form data encoding.voidsetHttpMethod(XltCharBuffer httpMethod) Set the httpMethod valuevoidsetHttpMethod(String httpMethod) Set the httpMethod valuevoidsetIpAddresses(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.voidsetRemainingValues(List<XltCharBuffer> values) Called by XLT during report creation to recreate the remaining object state from the passed string list.voidSets the request ID that was sent to the server.voidsetRequestId(String id) Sets the request ID that was sent to the server.voidsetResponseCode(int responseCode) Sets the request's response code.voidsetResponseCode(XltCharBuffer responseCode) Sets the request's response code.voidSets the response ID that was sent back by the server.voidsetResponseId(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.voidSets 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(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, setRunTimeMethods 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. -
NO_RESPONSE_CODE
No response code available
-
-
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
-
getOriginalUrl
Returns the request's original URL.- Returns:
- the original 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
-
setResponseCode
Sets the request's response code.- Parameters:
responseCode- the response code
-
getResponseCodeAsChars
Get the request's response code as originally recorded.- Returns:
- responseCode the response code as chars
-
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:
setRemainingValuesin interfaceData- Overrides:
setRemainingValuesin classTimerData- Parameters:
values- the string list to recreate the object state from- See Also:
-