This came out of discussion Dmitry and I were having today:
Today there's some code in early startup that records metrics by using the CachedMetrics mechanism, where the metrics are kept in Java memory until native is initialized and then recorded. Other instances of code, just check for LibraryLoader.isInitialized() and omit recording metrics in code if native isn't loaded yet. On top of it, cached metrics in child processes (e.g. renderer) don't get recorded at all because the record signal is tied to activity signals.
What we should probably have instead is a RecordMetrics abstraction that does the right thing under the hood:
- caches in java if native is not yet loaded
- uses better signals to learn when it's safe to record the metrics
- records native metrics as today when native is loaded
Comment 1 by asvitk...@chromium.org
, Apr 30 2018Status: Duplicate (was: Available)