PerformanceKt

public final class PerformanceKt


Summary

Public fields

final @NonNull FirebasePerformance

Accessing this object for Kotlin apps has changed; see the migration guide.

Public methods

static final void
PerformanceKt.trace(
    @NonNull HttpMetric receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull HttpMetricUnit> block
)

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

static final @NonNull T
<T extends Object> PerformanceKt.trace(
    @NonNull Trace receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull Trace, @NonNull T> block
)

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

static final @NonNull T
<T extends Object> trace(
    @NonNull String name,
    @ExtensionFunctionType @NonNull Function1<@NonNull Trace, @NonNull T> block
)

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Public fields

performance

public final @NonNull FirebasePerformance performance

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebasePerformance instance of the default FirebaseApp.

Important: In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.

Public methods

PerformanceKt.trace

public static final void PerformanceKt.trace(
    @NonNull HttpMetric receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull HttpMetricUnit> block
)

Measures the time it takes to run the block wrapped by calls to start and stop using HttpMetric.

Important: In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.

PerformanceKt.trace

public static final @NonNull T <T extends Object> PerformanceKt.trace(
    @NonNull Trace receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull Trace, @NonNull T> block
)

Measures the time it takes to run the block wrapped by calls to start and stop using Trace.

Important: In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.

trace

public static final @NonNull T <T extends Object> trace(
    @NonNull String name,
    @ExtensionFunctionType @NonNull Function1<@NonNull Trace, @NonNull T> block
)

Creates a Trace object with given name and measures the time it takes to run the block wrapped by calls to start and stop.

Important: In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.