startPerformanceStatisticsCollection

Enable real-time collection of map rendering performance statistics, for development purposes. Use after render() has been called for the first time.

Collects CPU, GPU resource usage and timings of layers and rendering groups over a user-configurable sampling duration. Use the collected information to find which layers or rendering groups might be performing poorly. Use PerformanceStatisticsOptions to configure the following statistics collection behaviors:

  • Specify the types of sampling: cumulative, per-frame, or both.
  • Define the minimum amount of time over which to perform sampling.

Utilize PerformanceStatisticsCallback to observe the collected performance statistics. The callback function is invoked after the configured sampling duration has elapsed. The callback is invoked on the main thread. The collection process is continuous; without user-input, it restarts after each callback invocation. Note: Specifying a negative sampling duration or omitting the callback function will result in no operation, which will be logged for visibility.

In order to stop the collection process, call stopPerformanceStatisticsCollection.

Parameters

options

Statistics collection options

callback

The callback to be invoked when statistics are available after the configured amount of time.