Jump to top

perf

interface

The Firebase Performance Monitoring service interface.

This module is available for the default app only.

Example

Get the Performance Monitoring service for the default app:

const defaultAppPerf = firebase.perf();

Properties

app

</>

The current FirebaseApp instance for this Firebase service.

dataCollectionEnabled

</>

Determines whether performance monitoring is enabled or disabled.

dataCollectionEnabled: boolean;

instrumentationEnabled

</>

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.

instrumentationEnabled: boolean;

isPerformanceCollectionEnabled

</>

Determines whether performance monitoring is enabled or disabled.

isPerformanceCollectionEnabled: boolean;

Methods

newHttpMetric

</>

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

newHttpMetric(url: string, httpMethod: HttpMethod): HttpMetric;

newScreenTrace

</>

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

newScreenTrace(identifier: string): ScreenTrace;

newTrace

</>

Creates a Trace instance with the given identifier.

newTrace(identifier: string): Trace;

setPerformanceCollectionEnabled

</>

Enables or disables performance monitoring.

setPerformanceCollectionEnabled(enabled: boolean): Promise<null>;

startScreenTrace

</>

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.

startScreenTrace(identifier: string): Promise<ScreenTrace>;

startTrace

</>

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

startTrace(identifier: string): Promise<Trace>;