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(
    int outcome,
    long totalDurationMillis,
    long lockWaitDurationMillis,
    long processingDurationMillis,
    long fetchDurationMillis,
    int callerUid
)

Public methods

boolean
equals(Object other)
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
@NonNull String

Public constructors

UpdateCheckTelemetry

Added in 1.0.0-alpha02
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-alpha02
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

Added in 1.0.0-alpha02
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

Added in 1.0.0-alpha02
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-alpha02
@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

Added in 1.0.0-alpha02
public final long getProcessingDurationMillis()

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

getTotalDurationMillis

Added in 1.0.0-alpha02
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()