# RecompositionTracer.TraceCollector

Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/tooling/RecompositionTracer.jvmAndAndroid.kt+class:androidx.compose.runtime.tooling.RecompositionTracer.TraceCollector) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.13.0-rc01) Common/AllAndroid/JVM
- android

  ```
  interface RecompositionTracer.TraceCollector
  ```

*** ** * ** ***

Records recomposition flow events.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/RecompositionTracer.TraceCollector#beginSection(kotlin.String,kotlin.collections.List)(sectionName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, flowIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>)` Begins a named trace section. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/RecompositionTracer.TraceCollector#endSection()()` Ends the current trace section. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/RecompositionTracer.TraceCollector#instantEvent(kotlin.String,kotlin.collections.List,kotlin.Int,kotlin.collections.List)( sectionName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html>, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, flowIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html> )` Records an instant trace event. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/RecompositionTracer.TraceCollector#isEnabled()()` Returns true if trace collector is currently active and accepting events. | android |

## Public functions

### beginSection

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.13.0-rc01)

```
fun beginSection(sectionName: String, flowIds: List<Long>): Unit
```

Begins a named trace section.

| Parameters |
|---|---|
| `sectionName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | name of the trace section |
| `flowIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | ids for the invalidation chain connecting events. |

### endSection

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.13.0-rc01)

```
fun endSection(): Unit
```

Ends the current trace section.

### instantEvent

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.13.0-rc01)

```
fun instantEvent(
    sectionName: String,
    stackTrace: List<StackTraceElement>,
    id: Int,
    flowIds: List<Long>
): Unit
```

Records an instant trace event.

| Parameters |
|---|---|
| `sectionName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | name of the trace event |
| `stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html>` | call stack associated with the event |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | unique identifier of the instance associated with events |
| `flowIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | ids for the invalidation chain connecting events.s |

### isEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.13.0-rc01)

```
fun isEnabled(): Boolean
```

Returns true if trace collector is currently active and accepting events.