Android Performance Monitoring Tool: Usage Guide and Underlying Principles
This article introduces a self‑developed Android performance monitoring app, explains how to install, start, and view test results, and details the underlying data‑collection mechanisms for memory, battery, CPU, and FPS metrics, providing practical guidance for developers.
Introduction
Recent research on Android application performance monitoring, analysis, and optimization led to the development of a simple‑to‑use tool that collects common performance indicators such as resource consumption, power usage, and rendering metrics.
1. Tool Usage
1.1 Start Test
(1) Install the performance monitoring app and open the main interface.
(2) Tap “Select Debugged App” to view the list of installed applications.
(3) Choose the target app, return to the start page, and press the start button to begin testing.
(4) To stop monitoring, return to the start page, tap the running button, and the data will be saved to sdcard/androidPerformance .
1.2 View Test Results
(1) Tap the top‑right button on the start page to open the results list; the latest result appears at the top.
(2) Select the newest result to see the performance metric display page.
(3) Up to eight metrics can be chosen to view their data curves.
2. Underlying Principles
2.1 Memory Information Collection
Memory consumption is a critical performance metric; excessive usage leads to frequent GC pauses, memory leaks shrink available memory, and insufficient memory can cause crashes. Android provides ActivityManager.MemoryInfo to obtain total and available memory.
Application‑specific memory usage can be retrieved via Debug.MemoryInfo and its totalPss field.
2.2 Battery Information Collection
The tool captures five battery parameters: level, voltage, temperature, status, and usage, using a broadcast receiver with Intent.ACTION_BATTERY_CHANGED .
2.3 CPU Information Collection
CPU data is read from the system files /proc/cpuinfo (static CPU characteristics) and /proc/stat (dynamic usage). Per‑process CPU usage can be obtained from /proc/pid/stat .
2.4 FPS Information Collection
FPS (Frames per second) reflects UI smoothness; achieving at least 24 fps is necessary for fluid experience, with 60 fps being ideal. FPS can be captured from the system layer (SurfaceFlinger) or the application layer (Choreographer).
Author
Ma Xinxin – Graduate of Northeastern University, Communications and Information Systems; joined Baidu in 2014, working in the Tieba division and Search Ecosystem Quality department on R&D and testing.
Baidu Intelligent Testing
Welcome to follow.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.