RenderThreadStatsRecorder

Recorder for tracking MapboxRenderThread frame stats.

Each map owns one recorder, available from MapView.renderThreadStatsRecorder or MapSurface.renderThreadStatsRecorder.

Note that RenderThreadStatsRecorder results are relevant when the map is continuously rendering (for example, during an animation).

Recording never makes the render thread wait. A frame rendered while start or stop is in progress on another thread may therefore be left out of the stats.

It is recommended to keep recording sessions short, calling start and stop every 1 to 2 seconds, and to aggregate the returned RenderThreadStats yourself if you need longer measurements. The recorder keeps every frame time of the current session in memory, so memory grows with the session length (about 0.5 KB per second at 60 FPS), and stop sorts all of them on the calling thread to compute percentiles. Short sessions keep both costs small.

Functions

Link copied to clipboard
fun start()

Start recording frame stats.

Link copied to clipboard

Stop recording and calculate final results.

Properties

Link copied to clipboard