To learn more about these features and how to add them to your app. In your code, you define the beginning and the end of a custom code trace (andĪdd any desired custom metrics) using the API provided by the Performance Monitoring SDK. You can also add custom metrics, such as cache hits and memory warnings. The default metric for a custom code trace is its duration, but With a custom code trace, you can measure how long it takes your app to completeĪ specific task or set of tasks, such as loading a set of images or querying To monitor performance data associated with specific code in your app, you can Step 5: (Optional) Add custom monitoring for specific code If your app isn't logging performance events, review the troubleshooting Presence of that network call shows that the browser is sending performance Open your browser's developer tools (for example,Ĭheck your log messages for any error messages.Īfter a few seconds, look for a network call toį in your browser's developer tools. Step 4: (Optional) View log messages for performance events If you don't see a display of your initial data, review the troubleshooting You should see your initial data display within Open for at least 10 seconds after the page loads. Generate events by loading subpages for your site, interacting with yourĪpp, and/or triggering network requests. Serve and view your web app in a local environment. So, there's a delay between an app interactionĪnd when Firebase receives the event information from your app. Note: The Performance Monitoring SDK batches events locally then sends them to Firebase If you're still developing locally, interact with your app to generateĮvents for initial data collection and processing. Step 3: Generate performance events for initial data displayįirebase starts processing the events when you successfully add the SDK to yourĪpp. For installationĪdding this polyfill library is not required for Performance Monitoring to report the other You need to add the polyfill library for this metric. Step 2: Add the first input delay polyfill library Initialize Performance Monitoring and get a reference to the service TODO: Replace the following with your app's Firebase project configurationĬonst app = initializeApp(firebaseConfig)
Install the Firebase JS SDK and initialize Firebase.Īdd the Performance Monitoring JS SDK and initialize Performance Monitoring: Step 1: Add and initialize Performance Monitoring Steps described later on this page (for example, adding the SDK and initializingįirebase). Note that when you add Firebase to your app, you might complete some of the
Want to start using the Performance Monitoring SDK, you must update your If you already use Firebase products in your existing web app and you Must add your app as a Firebase Web App in the To use Performance Monitoring in a web app, you
Before you beginĪdd Firebase to your JavaScript project to learn how to: This product might be changed in backward-incompatible ways and is not subject The Firebase JavaScript SDK for Performance Monitoring is a