---
title: "RecompositionTracer"
description: "Collects recomposition flow events."
type: "class"
---
## API Reference

> Source set: JvmAndAndroid

```kotlin
public class RecompositionTracer
```

Collects recomposition flow events.

Tracks the causal flow between state reads/writes and recomposition of [RecomposeScope](/jetpack-compose/androidx.compose.runtime/runtime/interfaces/RecomposeScope/api)s by
connecting to recomposition lifecycle and [Snapshot](/jetpack-compose/androidx.compose.runtime/runtime/classes/Snapshot/api) state events.

The traces are recorded in the Perfetto trace format through a provided `TraceCollector`.

NOTE: Recomposition tracing captures a stack trace and instance string on all state reads and
writes, which results a significant overhead. Avoid using it in production.
