React Native Firebase
    Preparing search index...

    The Firebase Performance Monitoring service interface.

    This module is available for the default app only.

    Get the Performance Monitoring service for the default app:

    const defaultAppPerf = firebase.perf();
    

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Creates a HttpMetric instance for collecting network performance data for a single request/response

      const metric = firebase.perf().newHttpMetric('https://api.com/user/1', 'GET');
      await metric.start();

      Parameters

      • url: string

        A valid url String, cannot be empty

      • httpMethod: HttpMethod

        One of the values GET, PUT, POST, DELETE, HEAD, PATCH, OPTIONS, TRACE, or CONNECT

      Returns HttpMetric

    • Creates a ScreenTrace instance with the given identifier. Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.

      try {
      const trace = firebase.perf().newScreenTrace('FooScreen');
      await trace.start();
      } catch (e) {

      }

      Parameters

      • identifier: string

        Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.

      Returns ScreenTrace

    • Creates a Trace instance with the given identifier.

      const trace = firebase.perf().newTrace('user_profile');
      await trace.start();

      Parameters

      • identifier: string

        Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.

      Returns Trace

    • Creates a ScreenTrace instance with the given identifier and immediately starts it. Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.

      try {
      const trace = await firebase.perf().startScreenTrace('FooScreen');
      await trace.stop();
      } catch (e) {

      }

      Parameters

      • identifier: string

        Name of the screen

      Returns Promise<ScreenTrace>

      android Android !== 9.0.0 && Android !== 9.1.0

    • Creates a Trace instance with the given identifier and immediately starts it.

      const trace = await firebase.perf().startTrace('user_profile');
      

      Parameters

      • identifier: string

        Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.

      Returns Promise<Trace>

    Properties

    The current FirebaseApp instance for this Firebase service.

    dataCollectionEnabled: boolean

    Determines whether performance monitoring is enabled or disabled.

    const isEnabled = firebase.perf().dataCollectionEnabled;
    console.log('Performance collection enabled: ', isEnabled);
    instrumentationEnabled: boolean

    Determines whether to collect 'out of the box' (i.e already setup for Firebase Performance) events. This can be set for iOS. Android will always return "true" as it has to be set at gradle level.

    isPerformanceCollectionEnabled: boolean

    Determines whether performance monitoring is enabled or disabled.

    const isEnabled = firebase.perf().isPerformanceCollectionEnabled;
    console.log('Performance collection enabled: ', isEnabled);