[null,null,["最后更新时间 (UTC):2023-09-25。"],[],[],null,["# Power Profiler\n\nStarting in Android Studio Hedgehog, the Power Profiler shows power consumption\non devices. You can view this new data in the On Device Power Rails Monitor (ODPM).\nIt segments the information by subsystems called \"Power Rails\". See [Profileable\npower rails](#power-rails) for a list of supported sub-systems.\n\nThe [System Trace](/studio/profile/cpu-profiler) records and displays power\nconsumption data. It is part of the CPU profiler This data helps you to visually\ncorrelate power consumption of the device with the actions occurring in your\napp. The Power Profiler enables visualizing this data.\n**Figure 1.** Example of power consumption in different power rails.\n\nProfileable power rails\n-----------------------\n\nThe ODPM reports all profileable power rails and is available in Android 10\n(API level 29) and higher and on Pixel 6 and subsequent Pixel devices.\n\n| Power rail name | Description |\n|-----------------|------------------------------------------------|\n| CPU Big | Power being consumed by the big CPU core. |\n| CPU Little | Power being consumed by the little CPU core. |\n| CPU Mid | Power being consumed by the mid CPU core. |\n| Camera | Power being consumed by the camera sensor. |\n| Cellular | Power being consumed by the cellular sensor. |\n| Display | Power being consumed by the display. |\n| GPS | Power being consumed by the GPS sensor. |\n| GPU | Power being consumed by the GPU sensor. |\n| Memory | Power being consumed by the RAM memory sensor. |\n| Sensor core | Power being consumed by other device sensors. |\n| UFS (disk) | Power being consumed by the Disk sensor. |\n| WLAN | Power being consumed by the Wifi sensor. |\n[**Table 1.** Availability of individual power rails is expected to\nchange based on the device being used.]\n\nDevices that don't support ODPM can offer power consumption data through Coulomb\ncounters and the battery gauge.\n\n| Name | Description |\n|----------|----------------------------------------------------------|\n| Capacity | The remaining battery percentage (%). |\n| Charge | The remaining battery charge in microampere-hours (µAh). |\n| Current | The instantaneous current in microampere (µA). |\n[**Table 2.** Power consumption data.]\n\nExample scenarios for profiling power consumption through the Power Profiler\n----------------------------------------------------------------------------\n\nAssume you are building an app that needs to download assets over the network.\nYou want to understand how the power consumption of WLAN power rail changes\nwhile downloading assets individually versus in a large chunk.\n\n**Scenario A:** The app makes individual network requests to download assets\nover WLAN.\n**Figure 2.** Individual network requests to download assets over WLAN.\n\n**Scenario B:** The app makes one network request to download a very large asset\nover WLAN.\n**Figure 3.** Individual network requests to download a very large asset over WLAN.\n\nAs shown in the preceding scenarios, the two system traces show different\nsignatures of power consumption in the WLAN power rail based on how you trigger\nthe download.\n\nEven though the preceding example is a simple way to measure power consumption\nin different scenarios, it demonstrates the process with which you can build\nmore sophisticated A/B tests for your app. You can use these tests to optimize\npower consumption across different features or different implementations of the\nsame feature.\n\nImportant notes\n---------------\n\n- ODPM measures power consumption at the device level---not specific to any app. You can correlate power consumption information from the ODPM to what's happening in your app foreground or background. As a result, you can expect noise in power consumption data based on how many apps are active in the device at the time of reading ODPM data.\n- Power Profiler reads power consumption data from the ODPM, which is only available on Pixel 6 and subsequent Pixel devices running Android 10 (API level 29) and higher.\n- Some power rails might only be available on some devices implementing ODPM."]]