Konsola git

Automatic traces for iOS and Android apps

A trace is a report of performance data captured between two points in time in your app. Performance Monitoring automatically provides the following types of traces for iOS and Android apps:

  • App start trace — Measures the time between when the user opens the app and when the app is responsive

  • App in background trace — Measures the time when the app is running in the background

  • App in foreground trace — Measures the time when the app is running in the foreground and available to the user

  • Screen trace — Spans the lifetime of a screen and measures slow and frozen frames

    Note that in the Firebase console, screen traces are displayed in a separate table from other traces so that you can more easily investigate the performance of different screens in your app.

Automatic trace definitions

Performance Monitoring uses method calls and notifications in your app to determine when each type of automatic trace starts and stops.

App start trace

This trace measures the time between when the user opens the app and when the app is responsive. In the console, the trace's name is _app_start, and the reported metric is Duration.

  • Starts when the application loads the first Object to memory.

  • Stops after the first successful run loop that occurs after the application receives the UIApplicationDidBecomeActiveNotification notification.

App in background trace

This trace measures the time when the app is running in the background. In the console, the trace's name is _app_in_background, and the reported metric is Duration.

  • Starts when the application receives the UIApplicationWillResignActiveNotification notification.

  • Stops when it receives the UIApplicationDidBecomeActiveNotification notification.

App in foreground trace

This trace measures the time when the app is running in the foreground and available to the user. In the console, the trace's name is _app_in_foreground, and the reported metric is Duration.

  • Starts when the application receives the UIApplicationDidBecomeActiveNotification notification.

  • Stops when it receives the UIApplicationWillResignActiveNotification notification.

Screen trace

This trace spans the lifetime of a screen and measures slow and frozen frames. The reported metrics for this trace are Slow rendering frames and Frozen frames.

Note that in the Firebase console, screen traces are displayed in a separate table from other traces so that you can more easily investigate the performance of different screens in your app.

  • Starts for every UIViewController in the keyWindow when the app calls viewDidAppear:.

  • Stops when the app calls viewDidDisappear:.

Note that screen traces don't capture canonical container view controllers.

Monitor automatic traces in the console

  1. In the Firebase console, go to the Performance dashboard.

  2. Click the On device tab, then you can:

    • View a quick report of the collected data for all your traces.

    • Click a specific trace to review the trace's data in more detail.

    Use the Filteradd button in the top-left of the dashboard to perform basic filtering of the data by attribute.

  3. If you click a specific trace, the console displays an overview of the collected data on metric cards.

    • For app start, app in foreground, and app in background traces, the Duration metric displays.

      Use the options in the top-right of the dashboard to view the duration data as aggregated, over time, or for each version of your app.

    • For screen traces, the Slow rendering and Frozen frames metrics display.

      Use the options in the top-right of the dashboard to view the percentage of screens that fall within the metric's threshold as aggregated, over time, or for each version of your app.

    Use the Filteradd button in the top-left of the dashboard to perform basic filtering of the data by attribute.

  4. For any metric, click View more to review more in-depth information about the collected data and to use richer analysis features. For example, you can filter and segment the data by attribute and view the data in the context of an app-usage session.

    The following section describes the available features of the in-depth trace report.

View more details on trace samples

You can deep dive into segments of specific traces or network requests in the Firebase console. A random sampling of recorded sessions shows the following information:

an image of the Firebase Performance Monitoring sessions page

  • CPU: How much user time and system time your app consumes.

  • Memory: How much heap memory your app uses. Heap memory is the memory used for dynamic allocations, including objects created, objects deallocated, and objects that the app is actively using.

  • Individual information: Detailed information about a single instance of a trace or network request, including start time, end time, duration, request size, and response size.

  • Concurrent instances: Information about traces or network requests that happened at the same time.

  • Device attributes: Information about the device, including app version, model, OS version, radio, and custom attributes.

To see these detailed samples in the Firebase console, you can either:

  • Open one of your app's traces or network requests, then click See sessions.

  • Click the link for an attribute's sessions from the specific attribute.

an image of the Firebase Performance Monitoring trace with a link to sessions

Filter sessions by percentile

The sessions that Performance Monitoring collects are distributed into percentiles for each metric. Sessions in lower percentile ranges have a lower value for the metric than sessions in higher percentile ranges.

To filter the available sessions by percentile, use the percentiles dropdown above the sessions details.

an image of the Firebase Performance Monitoring sessions page