Stay organized with collections
Save and categorize content based on your preferences.
PidHealthStats
class PidHealthStats
Keys for HealthStats
returned from HealthStats.getStats(int)
with the UidHealthStats.STATS_PIDS
key.
The values coming from PidHealthStats are a little bit different from the other HealthStats values. These values are not aggregate or historical values, but instead live values from when the snapshot is taken. These tend to be more useful in debugging rogue processes than in gathering aggregate metrics across the fleet of devices.
Summary
Constants |
static Int |
Key for a measurement of the current nesting depth of wakelocks for this process.
|
static Int |
Key for a measurement of the time in the android.os.SystemClock#elapsedRealtime timebase that a wakelock was first acquired in this process.
|
static Int |
Key for a measurement of the total number of milleseconds that this process has held a wake lock.
|
Constants
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PidHealthStats\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPidHealthStats\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/health/PidHealthStats \"View this page in Java\") \n\n```\nclass PidHealthStats\n```\n\n|---|---------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.os.health.PidHealthStats](#) |\n\nKeys for [HealthStats](/reference/kotlin/android/os/health/HealthStats) returned from [HealthStats.getStats(int)](/reference/kotlin/android/os/health/HealthStats#getStats(kotlin.Int)) with the [UidHealthStats.STATS_PIDS](/reference/kotlin/android/os/health/UidHealthStats#STATS_PIDS:kotlin.Int) key.\n\nThe values coming from PidHealthStats are a little bit different from the other HealthStats values. These values are not aggregate or historical values, but instead live values from when the snapshot is taken. These tend to be more useful in debugging rogue processes than in gathering aggregate metrics across the fleet of devices.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEASUREMENT_WAKE_NESTING_COUNT](#MEASUREMENT_WAKE_NESTING_COUNT:kotlin.Int) Key for a measurement of the current nesting depth of wakelocks for this process. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEASUREMENT_WAKE_START_MS](#MEASUREMENT_WAKE_START_MS:kotlin.Int) Key for a measurement of the time in the [android.os.SystemClock#elapsedRealtime](../SystemClock.html#elapsedRealtime()) timebase that a wakelock was first acquired in this process. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEASUREMENT_WAKE_SUM_MS](#MEASUREMENT_WAKE_SUM_MS:kotlin.Int) Key for a measurement of the total number of milleseconds that this process has held a wake lock. |\n\nConstants\n---------\n\n### MEASUREMENT_WAKE_NESTING_COUNT\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MEASUREMENT_WAKE_NESTING_COUNT: Int\n```\n\nKey for a measurement of the current nesting depth of wakelocks for this process. That is to say, the number of times a nested wakelock has been started but not stopped. A high number here indicates an improperly paired wakelock acquire/release combination.\n\nMore details on the individual wake locks is available by getting the [UidHealthStats.TIMERS_WAKELOCKS_FULL](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_FULL:kotlin.Int), [UidHealthStats.TIMERS_WAKELOCKS_PARTIAL](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_PARTIAL:kotlin.Int), [UidHealthStats.TIMERS_WAKELOCKS_WINDOW](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_WINDOW:kotlin.Int) and [UidHealthStats.TIMERS_WAKELOCKS_DRAW](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_DRAW:kotlin.Int) keys. \n\n Value: 20001\n\n### MEASUREMENT_WAKE_START_MS\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MEASUREMENT_WAKE_START_MS: Int\n```\n\nKey for a measurement of the time in the [android.os.SystemClock#elapsedRealtime](../SystemClock.html#elapsedRealtime()) timebase that a wakelock was first acquired in this process.\n\nMore details on the individual wake locks is available by getting the [UidHealthStats.TIMERS_WAKELOCKS_FULL](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_FULL:kotlin.Int), [UidHealthStats.TIMERS_WAKELOCKS_PARTIAL](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_PARTIAL:kotlin.Int), [UidHealthStats.TIMERS_WAKELOCKS_WINDOW](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_WINDOW:kotlin.Int) and [UidHealthStats.TIMERS_WAKELOCKS_DRAW](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_DRAW:kotlin.Int) keys. \n\n Value: 20003\n\n### MEASUREMENT_WAKE_SUM_MS\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MEASUREMENT_WAKE_SUM_MS: Int\n```\n\nKey for a measurement of the total number of milleseconds that this process has held a wake lock.\n\nMore details on the individual wake locks is available by getting the [UidHealthStats.TIMERS_WAKELOCKS_FULL](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_FULL:kotlin.Int), [UidHealthStats.TIMERS_WAKELOCKS_PARTIAL](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_PARTIAL:kotlin.Int), [UidHealthStats.TIMERS_WAKELOCKS_WINDOW](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_WINDOW:kotlin.Int) and [UidHealthStats.TIMERS_WAKELOCKS_DRAW](/reference/kotlin/android/os/health/UidHealthStats#TIMERS_WAKELOCKS_DRAW:kotlin.Int) keys. \n\n Value: 20002"]]