# UpdateCheckTelemetry

Artifact: [androidx.security:security-state-provider](https://developer.android.com/jetpack/androidx/releases/security) [View Source](https://cs.android.com/search?q=file:androidx/security/state/provider/UpdateCheckTelemetry.kt+class:androidx.security.state.provider.UpdateCheckTelemetry) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

*** ** * ** ***


```
public final class UpdateCheckTelemetry
```

<br />

*** ** * ** ***

Detailed telemetry data for a completed update check request.

This class encapsulates performance metrics and attribution data for a single invocation of the update check logic. It is provided to the host application via the `https://developer.android.com/reference/androidx/security/state/provider/UpdateInfoService#onRequestCompleted(androidx.security.state.provider.UpdateCheckTelemetry)` hook to enable monitoring of latency, resource contention, and client usage.

This class is immutable.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#UpdateCheckTelemetry(kotlin.Int,kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Int)( int outcome, long totalDurationMillis, long lockWaitDurationMillis, long processingDurationMillis, long fetchDurationMillis, int callerUid )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final int` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#getCallerUid()()` The Android User ID (UID) of the client application that initiated this request. |
| `final long` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#getFetchDurationMillis()()` The time (in milliseconds) spent waiting for the network fetch implementation to complete. |
| `final long` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#getLockWaitDurationMillis()()` The time (in milliseconds) spent waiting for the concurrency lock. |
| `final int` | `@https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome.Code https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#getOutcome()()` The outcome of the update check request. |
| `final long` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#getProcessingDurationMillis()()` The time (in milliseconds) spent processing the request **after acquiring the concurrency lock**. |
| `final long` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#getTotalDurationMillis()()` The total wall-clock time (in milliseconds) elapsed from the start of the request until the result was returned. |
| `int` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#toString()()` |

## Public constructors

### UpdateCheckTelemetry

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
public UpdateCheckTelemetry(
    int outcome,
    long totalDurationMillis,
    long lockWaitDurationMillis,
    long processingDurationMillis,
    long fetchDurationMillis,
    int callerUid
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getCallerUid

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
public final int getCallerUid()
```

The Android User ID (UID) of the client application that initiated this request.

This value is captured at the start of the transaction via `https://developer.android.com/reference/androidx/security/state/provider/UpdateInfoService#getCallerUid()`.

- **Default:** Represents the physical IPC caller (`Binder.getCallingUid()`).

- **Proxied:** If the host application overrides `getCallerUid` (e.g., to support a service broker architecture), this represents the *logical* client identity provided by that implementation.

**Usage:** Hosts should use this field to attribute resource usage, latency, and throttling events to specific client applications (e.g., differentiating between the System Settings app and a background telemetry agent).

### getFetchDurationMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
public final long getFetchDurationMillis()
```

The time (in milliseconds) spent waiting for the network fetch implementation to complete.

This is a subset of `https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#(kotlin.Int,kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Int)` that strictly measures the duration of the `https://developer.android.com/reference/androidx/security/state/provider/UpdateInfoService#fetchUpdates()` call, excluding local persistence and serialization overhead.

This value is 0 if no network fetch was attempted (e.g. for `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#CACHE_HIT()` or `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#THROTTLED()`, or `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#COALESCED()`).

### getLockWaitDurationMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
public final long getLockWaitDurationMillis()
```

The time (in milliseconds) spent waiting for the concurrency lock.

A high value here indicates "thundering herd" contention, where multiple clients are requesting updates simultaneously, causing threads to block while waiting for an in-progress fetch to complete.

### getOutcome

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
@UpdateFetchOutcome.Code
public final int getOutcome()
```

The outcome of the update check request.

Value is one of the constants allowed by `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome.Code`, such as `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#CACHE_HIT()`.

Value is one of the following:

- `1`
- `3`
- `4`
- `2`
- `5`

<br />

### getProcessingDurationMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
public final long getProcessingDurationMillis()
```

The time (in milliseconds) spent processing the request **after acquiring the concurrency lock**.

- This metric excludes the time spent waiting for the lock (`https://developer.android.com/reference/androidx/security/state/provider/UpdateCheckTelemetry#(kotlin.Int,kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Int)`).

- For `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#FETCHED()`, this includes the network request duration and disk persistence time.

- For `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#CACHE_HIT()`, this represents the time to read from local storage.

- For `https://developer.android.com/reference/androidx/security/state/provider/UpdateFetchOutcome#COALESCED()`, this represents the minimal time spent reading the freshly updated cache after the lock was acquired.

### getTotalDurationMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

```
public final long getTotalDurationMillis()
```

The total wall-clock time (in milliseconds) elapsed from the start of the request until the result was returned.

This represents the user-perceived latency of the IPC call.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```