Hi, I am looking for way to add screen trace log for firebase performance metric to compose screens (similar to slow rendering/frozen frames metric of activity and fragment). Any idea where we should start and stop the trace?
m
MR3Y
04/08/2022, 1:32 AM
Not sure if it is the best way but you can start the trace on every successful composition:
Copy code
@Composable
inline fun TraceCompositions() {
SideEffect { Trace.beginSection() }
}
And stop the trace within a DisposableEffect, something like: