IMPORTANT: In July 2025, we stopped releasing new versions of KTX modules, and we removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the previously released 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.
Stay organized with collections
Save and categorize content based on your preferences.
com.google.firebase.perf
Classes
Annotations
Top-level functions summary
inline T |
Creates a Trace object with given name and measures the time it takes to run the block wrapped by calls to start and stop.
|
Extension functions summary
inline Unit |
Measures the time it takes to run the block wrapped by calls to start and stop using HttpMetric .
|
inline T |
Measures the time it takes to run the block wrapped by calls to start and stop using Trace .
|
Extension properties summary
Top-level functions
trace
inline fun <T : Any?> trace(name: String, block: Trace.() -> T): T
Creates a Trace
object with given name
and measures the time it takes to run the block
wrapped by calls to start and stop.
Extension functions
trace
inline fun <T : Any?> Trace.trace(block: Trace.() -> T): T
Measures the time it takes to run the block
wrapped by calls to start and stop using Trace
.
Extension properties
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-21 UTC.
[null,null,["Last updated 2025-07-21 UTC."],[],[],null,["# com.google.firebase.perf\n========================\n\nClasses\n-------\n\n|--------------------------------------------------------------------------------------------|------------------------------------------|\n| [FirebasePerformance](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance) | The Firebase Performance Monitoring API. |\n\nAnnotations\n-----------\n\n|------------------------------------------------------------------------------------------------------------------|-------------------------------------------|\n| [FirebasePerformance.HttpMethod](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance.HttpMethod) | Valid HttpMethods for manual network APIs |\n\nTop-level functions summary\n---------------------------\n\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inline T` | `\u003cT : `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?\u003e `[trace](/docs/reference/kotlin/com/google/firebase/perf/package-summary#trace(kotlin.String,kotlin.Function1))`(name: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, block: `[Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace)`.() `-\u003e` T)` Creates a [Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace) object with given [name](/docs/reference/kotlin/com/google/firebase/perf/package-summary#trace(kotlin.String,kotlin.Function1)) and measures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/package-summary#trace(kotlin.String,kotlin.Function1)) wrapped by calls to start and stop. |\n\nExtension functions summary\n---------------------------\n\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inline `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric)`.`[trace](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.perf.metrics.HttpMetric).trace(kotlin.Function1))`(block: `[HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric)`.() `-\u003e` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Measures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.perf.metrics.HttpMetric).trace(kotlin.Function1)) wrapped by calls to start and stop using [HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric). |\n| `inline T` | `\u003cT : `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?\u003e `[Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace)`.`[trace](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.perf.metrics.Trace).trace(kotlin.Function1))`(block: `[Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace)`.() `-\u003e` T)` Measures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.perf.metrics.Trace).trace(kotlin.Function1)) wrapped by calls to start and stop using [Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace). |\n\nExtension properties summary\n----------------------------\n\n|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [FirebasePerformance](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance) | [Firebase](/docs/reference/kotlin/com/google/firebase/Firebase)`.`[performance](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.Firebase).performance()) Returns the [FirebasePerformance](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance) instance of the default [FirebaseApp](/docs/reference/kotlin/com/google/firebase/FirebaseApp). |\n\nTop-level functions\n-------------------\n\n### trace\n\n```\ninline fun \u003cT : Any?\u003e trace(name: String, block: Trace.() -\u003e T): T\n```\n\nCreates a [Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace) object with given [name](/docs/reference/kotlin/com/google/firebase/perf/package-summary#trace(kotlin.String,kotlin.Function1)) and measures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/package-summary#trace(kotlin.String,kotlin.Function1)) wrapped by calls to start and stop.\n\nExtension functions\n-------------------\n\n### trace\n\n```\ninline fun HttpMetric.trace(block: HttpMetric.() -\u003e Unit): Unit\n```\n\nMeasures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.perf.metrics.HttpMetric).trace(kotlin.Function1)) wrapped by calls to start and stop using [HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric). \n\n### trace\n\n```\ninline fun \u003cT : Any?\u003e Trace.trace(block: Trace.() -\u003e T): T\n```\n\nMeasures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/package-summary#(com.google.firebase.perf.metrics.Trace).trace(kotlin.Function1)) wrapped by calls to start and stop using [Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace).\n\nExtension properties\n--------------------\n\n### performance\n\n```\nval Firebase.performance: FirebasePerformance\n```\n\nReturns the [FirebasePerformance](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance) instance of the default [FirebaseApp](/docs/reference/kotlin/com/google/firebase/FirebaseApp)."]]