Rendering Performance Monitoring on Android
Article Summary
Booking.com's Android team built their own rendering performance monitoring system. Here's why Google Play Console metrics weren't enough.
Artem Grishin from Booking.com walks through implementing custom frame monitoring on Android. The article covers how to track slow and frozen frames per screen using FrameMetricsAggregator, going beyond the aggregated app-level data from Android Vitals.
Key Takeaways
- Each frame needs 16.6ms to hit 60fps; delays cause visible jank
- FrameMetricsAggregator from Android Jetpack tracks per-frame durations starting from Android 7
- Tie monitoring to activity lifecycle using ActivityLifecycleCallbacks for automatic tracking
- Parse SparseIntArray results to count frames over 17ms (slow) and 700ms (frozen)
- Google Play Console has 2-day delay and only shows app-level aggregates
You can build screen-level rendering performance monitoring in about 50 lines of Kotlin using Android Jetpack's FrameMetricsAggregator.
About This Article
Artem Grishin's team at Booking.com needed per-screen rendering performance data. Android Vitals only gave them app-level aggregates with a 2-day reporting delay, so they couldn't detect UX issues in real time.
They built a custom RenderMonitor class using FrameMetricsAggregator's TOTAL_INDEX metrics and ActivityLifecycleCallbacks. It automatically tracks frame timings when activities resume and pause.
Now developers can identify slow frames (17-700ms) and frozen frames (700ms+) for each screen. They catch rendering bottlenecks immediately instead of waiting for Google Play Console data.