title: [[WWDC 2020]]: What’s New MetricKit --- title: [[WWDC 2020]]: What’s New MetricKit --- - **Metdata** - Date: [[June 26th, 2020]] - Conference: [[WWDC 2020]] - Speaker(s): [[Phillip Azar]] - Video: https://developer.apple.com/videos/play/wwdc2020/10081 - Slides: - Tags: [[Talks]] - Using MetricKit - Provides Data in phases where you don’t have direct access to devices - AppStore - TestFlight - Real access to performance data in a large audience - Using MetricKit - Three easy Steps - Link MetricKit - Instantiate `MKMetricManager` - Conform to `MKMetricManagerSubscriber` - Implement the `didReceive` Method - Bundled into the 24 hour payload and anoymized - `MKMetricPayload` - Launch Times - CPU Times - 3 types - Cumulative - Average - Bucketed - Great for identifying regressions between builds - Next steps - How do we quantify this more precisely? - MetricKit 2.0 - New Metrics dive deeper into application workload, performance, and stability - CPU Instructions - Daily cumulative instructions retured - Hardware and frequency independent - Scroll hitches - A dropped frame during scrolling - Time ratio for UIScrollView scrolling - See [[[[WWDC]] 2020: Eliminate Animation Hitches with XCTest]] - Exit reasons - Foreground and background reasons - Diagnostics - New Diagnostics protocol - `MXMetricPayload` - `MXDiagnosicPayload` - When you see a regression the associated diagnostic payload - Maps 1:1 to it’s metric payload - API Deep Dive - `MXDiagnostic` - Metadat at regression data - Diagnostic specific data - `MXDiagnosticPayload` - `MXCallStackTree` - Backtrace at regression time - Unsymbolicated, meant for off device use - Regressions - `MXHangDiagnostic` - Time spent handing - Backtrace - `MXCPUExceptionDiagnostic` - CPU time consumed - Sampled time - Backtraces of threads spinning CPUs - `MXDiskWriteExceptionDiagnostic` - Total writes caused - 1GB daily write limit - `MXCrashDiagnostic` - Exception type, code, signal - Backtrace - Wrap Up