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 Summary

      • Fields inherited from interface com.xceptance.xlt.api.engine.Data

        DELIMITER
    • 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 Deprecated 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.
      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.
      java.lang.String getContentType()
      Returns the response's content type.
      int getDnsTime()
      Returns the time it took to look up the IP address for a host name.
      java.lang.String getFormData()
      Returns the form data.
      java.lang.String getFormDataEncoding()
      Returns the encoding of the form data.
      java.lang.String getHttpMethod()
      Returns the HTTP method of the request.
      java.lang.String getId()
      Deprecated.
      Use getRequestId() instead.
      java.lang.String[] getIpAddresses()
      Returns the list of IP addresses reported by DNS for the host name used when making the request.
      protected int getMinNoCSVElements()
      Returns the minimum number of elements in the CSV string.
      int getReceiveTime()
      Returns the time it took to receive the response from the server.
      java.lang.String getRequestId()
      Returns the request ID that was sent to the server.
      int getResponseCode()
      Returns the request's response code.
      java.lang.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.
      java.lang.String getUrl()
      Returns the request's URL.
      protected void parseValues​(java.lang.String[] values)
      Recreates the state of this object from an array of string values.
      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​(java.lang.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​(java.lang.String formData)
      Set the form data.
      void setFormDataEncoding​(java.lang.String encoding)
      Set the form data encoding.
      void setHttpMethod​(java.lang.String httpMethod)
      Set the httpMethod value
      void setId​(java.lang.String id)
      Deprecated.
      void setIpAddresses​(java.lang.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 setRequestId​(java.lang.String id)
      Sets the request ID that was sent to the server.
      void setResponseCode​(int responseCode)
      Sets the request's response code.
      void setResponseId​(java.lang.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​(java.lang.String url)
      Sets the request's URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.lang.String 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
      • getId

        @Deprecated
        public java.lang.String getId()
        Deprecated.
        Use getRequestId() instead.
        Returns the request ID that was sent to the server.
        Returns:
        the request ID
      • 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 java.lang.String getUrl()
        Returns the request's URL.
        Returns:
        the URL
      • getHttpMethod

        public java.lang.String getHttpMethod()
        Returns the HTTP method of the request.
        Returns:
        the HTTP method.
      • getFormDataEncoding

        public java.lang.String getFormDataEncoding()
        Returns the encoding of the form data.
        Returns:
        the data encoding.
      • getFormData

        public java.lang.String 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
      • 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
      • setReceiveTime

        public void setReceiveTime​(int receiveTime)
        Sets the time it took to receive the response from the server.
        Parameters:
        receiveTime - the receive time
      • setId

        @Deprecated
        public void setId​(java.lang.String id)
        Deprecated.
        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​(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.
        Parameters:
        url - the URL
      • setHttpMethod

        public void setHttpMethod​(java.lang.String httpMethod)
        Set the httpMethod value
        Parameters:
        httpMethod - the new httpMethod value
      • setFormDataEncoding

        public void setFormDataEncoding​(java.lang.String encoding)
        Set the form data encoding.
        Parameters:
        encoding - the new encoding
      • 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
      • 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.
        Overrides:
        addValues in class TimerData
        Returns:
        the list of values
      • getMinNoCSVElements

        protected int getMinNoCSVElements()
        Returns the minimum number of elements in the CSV string.
        Overrides:
        getMinNoCSVElements in class TimerData
        Returns:
        minimum number of elements in the CSV string
      • parseValues

        protected void parseValues​(java.lang.String[] values)
        Recreates the state of this object from an array of string values. Override this method in sub classes to restore custom values, but do not forget to call the super class first.
        Overrides:
        parseValues in class TimerData
        Parameters:
        values - the list of values, must have at least the length AbstractData.getMinNoCSVElements()