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 `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:
  - `ActionData`
  - `TransactionData`
  - `CustomData`
  - `EventData`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final XltCharBuffer`
  `NO_RESPONSE_CODE`
  No response code available
  `static final XltCharBuffer`
  `UNKNOWN_HOST`
  The 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(String name)`
  Creates a new RequestData object and gives it the specified name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBytesReceived()`
  Returns the size of the response message.
  `int`
  `getBytesSent()`
  Returns the size of the request message.
  `int`
  `getConnectTime()`
  Returns the time it took to connect to the server.
  `XltCharBuffer`
  `getContentType()`
  Returns the response's content type.
  `int`
  `getDnsTime()`
  Returns the time it took to look up the IP address for a host name.
  `XltCharBuffer`
  `getFormData()`
  Returns the form data.
  `XltCharBuffer`
  `getFormDataEncoding()`
  Returns the encoding of the form data.
  `XltCharBuffer`
  `getHost()`
  Returns the host parsed from the url or UNKNOWN_HOST if it does not exist.
  `XltCharBuffer`
  `getHttpMethod()`
  Returns the HTTP method of the request.
  `String[]`
  `getIpAddresses()`
  Returns the list of IP addresses reported by DNS for the host name used when making the request.
  `String`
  `getOriginalUrl()`
  Returns the request's original URL.
  `int`
  `getReceiveTime()`
  Returns the time it took to receive the response from the server.
  `String`
  `getRequestId()`
  Returns the request ID that was sent to the server.
  `int`
  `getResponseCode()`
  Returns the request's response code.
  `XltCharBuffer`
  `getResponseCodeAsChars()`
  Get the request's response code as originally recorded.
  `String`
  `getResponseId()`
  Returns the response ID that was sent back by the server.
  `int`
  `getSendTime()`
  Returns the time it took to send the request to the server.
  `int`
  `getServerBusyTime()`
  Returns the time it took the server the process the request.
  `int`
  `getTimeToFirstBytes()`
  Returns the time until the first response bytes arrived, including connect time and server busy time.
  `int`
  `getTimeToLastBytes()`
  Returns the time needed to read all response bytes, including connect time and server busy time.
  `XltCharBuffer`
  `getUrl()`
  Returns the request's URL.
  `XltCharBuffer`
  `getUsedIpAddress()`
  Returns the target IP address of the system under test that was used when making the request.
  `int`
  `hashCodeOfUrlWithoutFragment()`
  Returns the hashcode of the fragment free version of the url
  `void`
  `setBytesReceived(int responseSize)`
  Sets the size of the response message
  `void`
  `setBytesSent(int requestSize)`
  Sets the size of the request message
  `void`
  `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 value
  `void`
  `setHttpMethod(String httpMethod)`
  Set the httpMethod value
  `void`
  `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`
  `setRequestId(XltCharBuffer id)`
  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`
  `setResponseCode(XltCharBuffer responseCode)`
  Sets the request's response code.
  `void`
  `setResponseId(XltCharBuffer id)`
  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 attribute
  `void`
  `setTimeToLastBytes(int timeToLastBytes)`
  Set the timeToLastBytes attribute
  `void`
  `setUrl(XltCharBuffer url)`
  Sets the request's URL.
  `void`
  `setUrl(String url)`
  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.
  `List<String>`
  `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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### UNKNOWN_HOST

    public static final XltCharBuffer UNKNOWN_HOST
    The value to show if the host could not be determined from a URL.

  - ### NO_RESPONSE_CODE

    public static final XltCharBuffer NO_RESPONSE_CODE
    No response code available

- ## Constructor Details

  - ### RequestData

    public RequestData()
    Creates a new RequestData object.

  - ### RequestData

    public RequestData(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 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

    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 String getRequestId()
    Returns the request ID that was sent to the server.
    Returns:
      the request ID

  - ### getResponseId

    public 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

  - ### getOriginalUrl

    public String 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

    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 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(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(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(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

  - ### setResponseCode

    public void setResponseCode(XltCharBuffer responseCode)
    Sets the request's response code.
    Parameters:
      `responseCode` - the response code

  - ### getResponseCodeAsChars

    public XltCharBuffer 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

    public void setUrl(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(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(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(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(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(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

  - ### toList

    public List<String> 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.

    Specified by:
      `toList` in interface `Data`
    Overrides:
      `toList` in class `TimerData`
    Returns:
      the list of values that form the state of this object
    See Also:
      - `Data.setBaseValues(List)`
      - `Data.setRemainingValues(List)`

  - ### setRemainingValues

    public void setRemainingValues(List<XltCharBuffer> values)
    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 calling `Data.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 interface `Data`
    Overrides:
      `setRemainingValues` in class `TimerData`
    Parameters:
      `values` - the string list to recreate the object state from
    See Also:
      - `Data.setBaseValues(List)`
      - `Data.toList()`