RequestFinishedInfo.Metrics

abstract class RequestFinishedInfo.Metrics


Metrics collected for a single request. Most of these metrics are timestamps for events during the lifetime of the request, which can be used to build a detailed timeline for investigating performance.

Events happen in this order:

  1. request start
  2. DNS start
  3. DNS end
  4. connect start
  5. SSL start
  6. SSL end
  7. connect end
  8. sending start
  9. sending end
  10. response start
  11. request end
Start times are reported as the time when a request started blocking on event, not when the event actually occurred, with the exception of push start and end. If a metric is not meaningful or not available, including cases when a request finished before reaching that stage, start and end times will be null. If no time was spent blocking on an event, start and end will be the same time.

If the system clock is adjusted during the request, some of the java.util.Date values might not match it. Timestamps are recorded using a clock that is guaranteed not to run backwards. All timestamps are correct relative to the system clock at the time of request start, and taking the difference between two timestamps will give the correct difference between the events. In order to preserve this property, timestamps for events other than request start are not guaranteed to match the system clock at the times they represent.

Most timing metrics are taken from LoadTimingInfo, which holds the information for and .

Summary

Public constructors

Public functions

abstract Date?

Returns time when connection establishment finished.

abstract Date?

Returns time when connection establishment started.

abstract Date?

Returns time when DNS lookup finished.

abstract Date?

Returns time when DNS lookup started.

abstract Date?

Returns time when last byte of HTTP/2 server push was received.

abstract Date?

Returns time when first byte of HTTP/2 server push was received.

abstract Long?

Returns total bytes received over the network transport layer, or null if not collected.

abstract Date?

Returns time when the request finished.

abstract Date?

Returns time when the request started.

abstract Date?

Returns time when the end of the response headers was received.

abstract Date?

Returns time when sending the request finished.

abstract Date?

Returns time when sending the request started.

abstract Long?

Returns total bytes sent over the network transport layer, or null if not collected.

abstract Boolean

Returns whether the socket was reused from a previous request.

abstract Date?

Returns time when SSL handshake finished.

abstract Date?

Returns time when SSL handshake started.

abstract Long?

Returns milliseconds between request initiation and finish, including a failure or cancellation, or null if not collected.

abstract Long?

Returns milliseconds between request initiation and first byte of response headers, or null if not collected.

Public constructors

Metrics

Metrics()

Public functions

getConnectEnd

abstract fun getConnectEnd(): Date?

Returns time when connection establishment finished.

Returns
Date?

java.util.Date representing when connection establishment finished, after TCP connection is established and, if using HTTPS, SSL handshake is completed. For QUIC 0-RTT, this represents the time of handshake confirmation and might happen later than getSendingStart. null if the socket was reused (see getSocketReused).

getConnectStart

abstract fun getConnectStart(): Date?

Returns time when connection establishment started.

Returns
Date?

java.util.Date representing when connection establishment started, typically when DNS resolution finishes. null if the socket was reused (see getSocketReused).

getDnsEnd

abstract fun getDnsEnd(): Date?

Returns time when DNS lookup finished. This and getDnsStart will return non-null values regardless of whether the result came from a DNS server or the local cache.

Returns
Date?

java.util.Date representing when DNS lookup finished. null if the socket was reused (see getSocketReused).

getDnsStart

abstract fun getDnsStart(): Date?

Returns time when DNS lookup started. This and getDnsEnd will return non-null values regardless of whether the result came from a DNS server or the local cache.

Returns
Date?

java.util.Date representing when DNS lookup started. null if the socket was reused (see getSocketReused).

getPushEnd

abstract fun getPushEnd(): Date?

Returns time when last byte of HTTP/2 server push was received.

Returns
Date?

java.util.Date representing when the last byte of an HTTP/2 server push was received. null if server push is not used.

getPushStart

abstract fun getPushStart(): Date?

Returns time when first byte of HTTP/2 server push was received.

Returns
Date?

java.util.Date representing when the first byte of an HTTP/2 server push was received. null if server push is not used.

getReceivedByteCount

abstract fun getReceivedByteCount(): Long?

Returns total bytes received over the network transport layer, or null if not collected. Number of bytes does not include any previous redirects.

getRequestEnd

abstract fun getRequestEnd(): Date?

Returns time when the request finished.

Returns
Date?

java.util.Date representing when the request finished.

getRequestStart

abstract fun getRequestStart(): Date?

Returns time when the request started.

Returns
Date?

java.util.Date representing when the native request actually started. This timestamp will match the system clock at the time it represents.

getResponseStart

abstract fun getResponseStart(): Date?

Returns time when the end of the response headers was received.

Returns
Date?

java.util.Date representing when the end of the response headers was received.

getSendingEnd

abstract fun getSendingEnd(): Date?

Returns time when sending the request finished.

Returns
Date?

java.util.Date representing when sending HTTP request body finished. (Sending request body happens after sending request headers.)

getSendingStart

abstract fun getSendingStart(): Date?

Returns time when sending the request started.

Returns
Date?

java.util.Date representing when sending HTTP request headers started.

getSentByteCount

abstract fun getSentByteCount(): Long?

Returns total bytes sent over the network transport layer, or null if not collected.

getSocketReused

abstract fun getSocketReused(): Boolean

Returns whether the socket was reused from a previous request. In HTTP/2 or QUIC, if streams are multiplexed in a single connection, returns true for all streams after the first.

Returns
Boolean

whether this request reused a socket from a previous request. When true, DNS, connection, and SSL times will be null.

getSslEnd

abstract fun getSslEnd(): Date?

Returns time when SSL handshake finished. For QUIC, this will be the same time as getConnectEnd.

Returns
Date?

java.util.Date representing when SSL handshake finished. null if SSL is not used or if the socket was reused (see getSocketReused).

getSslStart

abstract fun getSslStart(): Date?

Returns time when SSL handshake started. For QUIC, this will be the same time as getConnectStart.

Returns
Date?

java.util.Date representing when SSL handshake started. null if SSL is not used or if the socket was reused (see getSocketReused).

getTotalTimeMs

abstract fun getTotalTimeMs(): Long?

Returns milliseconds between request initiation and finish, including a failure or cancellation, or null if not collected. TODO(mgersh): Remove once new API works http://crbug.com/629194

getTtfbMs

abstract fun getTtfbMs(): Long?

Returns milliseconds between request initiation and first byte of response headers, or null if not collected. TODO(mgersh): Remove once new API works http://crbug.com/629194