Class 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 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
      • toList

        public java.util.List<java.lang.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​(java.util.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()