Open In App

How to Use Performance Console in Firebase with Android?

Improve
Improve
Like Article
Like
Save
Share
Report

You can use the Firebase Performance Monitoring service to learn more about the performance traits of your Apple, Android, and web apps. As you roll out new features or make configuration changes, Firebase Performance Monitoring, a real-time app performance monitoring tool, enables you to keep a close check on your app. With a dashboard that is easily customized, Performance Monitoring also provides you control over your performance data and makes it simple to concentrate on your most crucial indicators.

You gather performance data from your app using the Performance Monitoring SDK, and you review and evaluate that data in the Firebase console. You may utilize the information from performance monitoring to identify areas of your app’s performance that can be enhanced in real time and address those concerns.

Image #1: The Firebase Performance Dashboard

Image #1: The Firebase Performance Dashboard

Like all the other articles in this series let’s dive deep into the topic and find out what key features are provided to us by the Performance Metric: 

Particulars

Features

Discover scenarios where the performance of your app could be improved. When you are unsure of the precise cause of your app’s performance issues, it can be difficult to improve it. You may view performance metrics split down by characteristics like country, device, app version, and OS level thanks to Performance Monitoring.
Easy setup and work You don’t need to add any code after integrating the Performance Monitoring SDK into your app for it to begin automatically tracking the number of crucial performance metrics.
The SDK records launch time, rendering information by screen, and activity whether the program is running in the foreground or background for native apps. The SDK for web apps records information about your app’s first contentful paint, user interaction capabilities, and more.
Track and learn about the changes in your app The success of your app depends on your ability to recognize and fix critical app performance issues, such as network disruptions. Performance Monitoring enables you to set up and configure alerts for the most important components of your app so you can identify performance issues and take appropriate action before they negatively impact your users.
Make your app’s monitoring specific. To record the performance of your app in particular circumstances, such as when you load a new screen or present a new interactive feature, you can instrument bespoke code traces. Additionally, you may build custom metrics on these custom code traces to count events that occur during those traces (such as cache hits).

ProTip: The Remote Config SDK is automatically added as a dependency when the Performance Monitoring SDK is added to your app. If you currently utilize Remote Config, there is no difference.

However, if you’re unfamiliar with Remote Config, look through the documentation to find out more about the various features your app will be able to access. Now let’s see what all capabilities the Performance Metric has to offer us and how it manages to work!

Working Principle

Traces are used in performance monitoring to gather information on these processes. A trace is a report that includes information from your app that was collected between two points in time. Metrics are the performance data that are gathered for each trace and they differ depending on the type of trace. The linked trace additionally automatically gathers attribute data for each time an instance of your app executes a monitored process. For instance, the trace gathers the device, app version, and other information for that particular app instance when an Android app sends a network request. These characteristics can be used to filter your performance data and determine which user segments are having problems.

To learn more about the performance of particular tasks or flows, try instrumenting your own unique traces of code in your app in addition to the out-of-the-box traces provided by Performance Monitoring. For instance, when a network request is made by an instance of your app, the trace gathers metrics like response time and payload size that are crucial for network request monitoring.

How to Implement Firebase Performance Metric in Your Application

Step #1: Add Firebase to your application

The first step is to set up your project and add firebase to your project. Along with any other Firebase products you choose to use in your project, you may include the Performance Monitoring SDK.

Step #2: Create custom metrics and code traces for your app

These will help you to monitor specific values and targets which you want to look out for, in your application. You can instrument bespoke code traces and custom metrics to measure particular areas of your app’s performance using the Performance Monitoring SDK.

Step #3: Real-time performance data monitoring on the console

You can track user performance data in the Firebase console to identify the precise circumstances where your app’s performance could be enhanced. The performance statistics can also be divided into categories such as app version, country, device, or OS. That’s it, those are the basic timelines involved with the implementation of real-time performance and data monitoring at the same time.

Let’s Add Performance Metrics to our app, and check how it works using the console in Android

Step #1: Add the performance dependency in your Android’s Build.Gradle file

Start by simply adding these two dependencies to your build.gradle file:

implementation 'com.google.firebase:firebase-perf'
implementation platform('com.google.firebase:firebase-bom:31.1.1')   

After this sync your gradle so that we can start working with new changes.

Step #2: Add a plugin to your app to measure the performance metric

The next step is to add the simple plugin to your app so that it can be registered with the Firebase Performance Console.

dependencies {
        ...     
        // All your other plugins go here
        classpath 'com.google.firebase:perf-plugin:1.4.2'
    }

Step #3: Start processing your events using the FIrebase Performance Console

When you successfully integrate the SDK into your app, Firebase begins processing the events. Interact with your app to create events for basic data gathering and processing if you’re still working locally on it.

Image #2: The firebase console performance metric will start showing you the metrics when they are ready.

Image #2: The firebase console performance metric will start showing you the metrics when they are ready.

And that’s how you will integrate your application with Firebase Performance Console Metric!

Conclusion

Performance Monitoring does not retain any personally identifying data over the long term (such as names, email addresses, or phone numbers). Performance Monitoring builds aggregated and anonymized URL patterns while tracking HTTP network requests. These patterns are finally saved and displayed in the Firebase console.


Last Updated : 14 Dec, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads