Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions) Summary: [Methods](https://developer.android.com/reference/android/net/http/FinishedRequestTimings#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/http/FinishedRequestTimings#inhmethods)

# FinishedRequestTimings

*** ** * ** ***

` public final class FinishedRequestTimings `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.http.FinishedRequestTimings |

<br />

*** ** * ** ***

Metrics collected for a single request. Most of these metrics are timestamps for events during the lifetime of the `https://developer.android.com/reference/android/net/http/BidirectionalStream` or `https://developer.android.com/reference/android/net/http/UrlRequest`, which can be used to build a detailed timeline for investigating performance.

Timestamps are derived from a monotonic clock.

Start times are reported as the time when a request started waiting for an event, not when the event actually started. If a metric is 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.

A metric can be null if it's unavailable (e.g. SSL metrics are null if the host name was not resolved).

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getConnectingEnd()() ` Returns the timestamp for when the connection establishment ended. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getConnectingStart()() ` Returns the timestamp for when the connection attempt began. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getDnsEnd()() ` Returns the timestamp when the DNS lookup finished. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getDnsStart()() ` Returns the timestamp when DNS lookup started. |
| ` long` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getReceivedByteCount()() ` Returns total bytes received. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getRequestEnd()() ` Returns the timestamp when the request finished. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getRequestStart()() ` Returns the timestamp when the request started. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getSendingEnd()() ` Returns the timestamp when sending the request finished. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getSendingStart()() ` Returns the timestamp when sending the request started. |
| ` long` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getSentByteCount()() ` Returns total bytes sent. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getTlsHandshakeEnd()() ` Returns the timestamp when TLS handshake finished. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getTlsHandshakeStart()() ` Returns the timestamp when TLS handshake started. |
| ` boolean` | ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings#wasSocketReused()() ` Returns whether the socket was reused from a previous request. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### getConnectingEnd

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getConnectingEnd ()
```

Returns the timestamp for when the connection establishment ended. If the connection used by the request is already active, this returns null.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing when the connection establishment finished. If using HTTPS, TLS handshake is completed. In some cases, such as 0-RTT, the stack may start sending data before connection establishment is considered complete; in such cases, this timestamp may occur after `https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getSendingStart()`. <br /> |

### getConnectingStart

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getConnectingStart ()
```

Returns the timestamp for when the connection attempt began. If a connection is already active, this returns null.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing when the connection establishment started, or null. <br /> |

### getDnsEnd

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getDnsEnd ()
```

Returns the timestamp when the DNS lookup finished.

This value is `null` if no DNS lookup was required, such as when the request reuses an existing connection. If a lookup was attempted, this value will be non-null, regardless of whether the lookup succeeded (via network or cache) or failed.

See `https://developer.android.com/` for more detailed timing information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | the `https://developer.android.com/reference/java/time/Instant` when the DNS lookup completed, or `null` if no lookup was performed. <br /> |

### getDnsStart

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getDnsStart ()
```

Returns the timestamp when DNS lookup started. If a connection is already active, this returns null.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing when the DNS lookup started, or null. <br /> |

### getReceivedByteCount

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public long getReceivedByteCount ()
```

Returns total bytes received.

<br />

| Returns ||
|---|---|
| `long` | Value is 0 or greater <br /> |

### getRequestEnd

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getRequestEnd ()
```

Returns the timestamp when the request finished.

This value is `null` if the request failed to start, as documented in `https://developer.android.com/reference/android/net/http/FinishedRequestTimings#getRequestStart()`. If the request started successfully, this reflects the time it reached a terminal state, including success, failure, or cancellation.

See `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | the `https://developer.android.com/reference/java/time/Instant` when the request finished, or `null` if the request never started. <br /> |

### getRequestStart

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getRequestStart ()
```

Returns the timestamp when the request started.

This value is `null` if the request fails initial validation checks during `https://developer.android.com/reference/android/net/http/UrlRequest#start()` or `https://developer.android.com/` (for example, if an invalid header is provided).

See `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | the `https://developer.android.com/reference/java/time/Instant` when the request began, or `null` if the request failed before starting. <br /> |

### getSendingEnd

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getSendingEnd ()
```

Returns the timestamp when sending the request finished.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing the end of sending HTTP request (including the body). This value may be `null`. <br /> |

### getSendingStart

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getSendingStart ()
```

Returns the timestamp when sending the request started.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing the beginning of sending HTTP request headers. This value may be `null`. <br /> |

### getSentByteCount

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public long getSentByteCount ()
```

Returns total bytes sent.

<br />

| Returns ||
|---|---|
| `long` | Value is 0 or greater <br /> |

### getTlsHandshakeEnd

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getTlsHandshakeEnd ()
```

Returns the timestamp when TLS handshake finished. This will always be equal to `https://developer.android.com/`.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing when the TLS establishment finished. This value may be `null`. <br /> |

### getTlsHandshakeStart

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public Instant getTlsHandshakeStart ()
```

Returns the timestamp when TLS handshake started.

See the documentation on `https://developer.android.com/` for more information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | `https://developer.android.com/reference/java/time/Instant` representing when the TLS handshake has started. This will be later than getConnectStart. In cases where the TLS handshake is started immediately (e.g. QUIC), this may be equal to getConnectStart. This value may be `null`. <br /> |

### wasSocketReused

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public boolean wasSocketReused ()
```

Returns whether the socket was reused from a previous request. Cases where this can happen include: reusing an idle socket that was used to complete a previous HTTP/1 request; multiplexing streams on a single HTTP/2 or QUIC connection.

Note that when a socket is reused, then DNS, connect and SSL timings are meaningless and undefined, as the request did not go through any of these stages.

<br />

| Returns ||
|---|---|
| `boolean` | true if a socket has been reused. <br /> |