UpdateCheckTelemetry
public final class UpdateCheckTelemetry
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 UpdateInfoService.onRequestCompleted hook to enable monitoring of latency, resource contention, and client usage.
This class is immutable.
Summary
Public constructors |
|---|
UpdateCheckTelemetry( |
Public methods |
|
|---|---|
boolean |
|
final int |
The Android User ID (UID) of the client application that initiated this request. |
final long |
The time (in milliseconds) spent waiting for the network fetch implementation to complete. |
final long |
The time (in milliseconds) spent waiting for the concurrency lock. |
final int |
The outcome of the update check request. |
final long |
The time (in milliseconds) spent processing the request after acquiring the concurrency lock. |
final long |
The total wall-clock time (in milliseconds) elapsed from the start of the request until the result was returned. |
int |
hashCode() |
@NonNull String |
toString() |
Public constructors
UpdateCheckTelemetry
public UpdateCheckTelemetry(
int outcome,
long totalDurationMillis,
long lockWaitDurationMillis,
long processingDurationMillis,
long fetchDurationMillis,
int callerUid
)
Public methods
getCallerUid
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 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
public final long getFetchDurationMillis()
The time (in milliseconds) spent waiting for the network fetch implementation to complete.
This is a subset of processingDurationMillis that strictly measures the duration of the UpdateInfoService.fetchUpdates call, excluding local persistence and serialization overhead.
This value is 0 if no network fetch was attempted (e.g. for UpdateFetchOutcome.CACHE_HIT or UpdateFetchOutcome.THROTTLED, or UpdateFetchOutcome.COALESCED).
getLockWaitDurationMillis
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
@UpdateFetchOutcome.Code
public final int getOutcome()
The outcome of the update check request.
Value is one of the constants allowed by UpdateFetchOutcome.Code, such as UpdateFetchOutcome.CACHE_HIT.
getProcessingDurationMillis
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 (
lockWaitDurationMillis). -
For
UpdateFetchOutcome.FETCHED, this includes the network request duration and disk persistence time. -
For
UpdateFetchOutcome.CACHE_HIT, this represents the time to read from local storage. -
For
UpdateFetchOutcome.COALESCED, this represents the minimal time spent reading the freshly updated cache after the lock was acquired.
getTotalDurationMillis
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.