Skip to content

Performance Get Started

Eoin Landy edited this page Jan 30, 2020 · 2 revisions

The contents of this page are based on the original Firebase Documentation

This guide shows you how to use Firebase Performance Monitoring with your app.

Add Performance Monitoring to your app

A custom trace is a report of performance data associated with some of the code in your app. To learn more about custom traces, see the Performance Monitoring overview. You can have multiple custom traces in your app, and it is possible to have more than one custom trace running at a time. Each custom trace can have one or more metrics to count performance-related events in your app, and those metrics are associated with the traces that create them.

import com.tuarua.firebase.PerformanceANE;
import com.tuarua.firebase.performance.Trace;

private var tracer:Trace;

Just before the code where you want to start a trace in your app, add the following lines of code to start a trace called test trace()

tracer = new Trace("test_trace");
tracer.start();

To count performance-related events that occur in your app (such as cache hits or retries), add a line of code similar to the following each time that the event occurs, using a string other than retry to name that event if you are counting a different type of event:

tracer.incrementMetric("hits");

Just after the code where you want to stop your trace, add the following line of code:

tracer.stop();

Check the Firebase console for Performance Monitoring results

  1. Run your app on your device.
  2. Confirm that Performance Monitoring results appear in the Firebase console. Results should appear within 12 hours.

Deploy your app and review results in the Firebase console

After you have validated Performance Monitoring using the Xcode simulator and one or more test devices, you can deploy the updated version of your app to your users and use the Firebase console to monitor performance data.

Clone this wiki locally