Complete the code to initialize Firebase Performance Monitoring in your app.
import { getPerformance } from 'firebase/performance'; const perf = [1](app);
The getPerformance function initializes Performance Monitoring for the Firebase app instance.
Complete the code to trace a custom performance metric named 'load_time'.
const trace = perf.[1]('load_time'); trace.start(); // ... some code ... trace.stop();
The trace method creates a custom trace to measure performance.
Fix the error in the code to correctly enable data collection for Performance Monitoring.
import { getPerformance, [1] } from 'firebase/performance'; const perf = getPerformance(app); [1](perf, true);
The correct function to enable or disable data collection is setPerformanceCollectionEnabled.
Fill both blanks to create a trace and add a custom metric named 'items_processed' with value 5.
const trace = perf.[1]('process_trace'); trace.[2]('items_processed', 5); trace.start(); trace.stop();
Use trace to create the trace and putMetric to add a custom metric with a specific value.
Fill all three blanks to create a trace, increment a metric named 'clicks', and start the trace.
const trace = perf.[1]('click_trace'); trace.[2]('clicks'); trace.[3]();
putMetric instead of incrementMetric when incrementing.Create the trace with trace, increment the metric with incrementMetric, and start the trace with start.