SharedPerformance
Entry point for creating performance metrics. This object can be used to measure or trace the time between events from different parts of the sdk. Be sure to complete the instances when you use this.
When to use Measure vs Trace:
Measure is for debug logging and can be used as an enhanced local logger.
This does not have indexing limitations so you can use it to log unique values or identifiers.
Useful for debug logging that can be helpful for understanding the performance. Trace is used for uploading performance metrics to service dashboards like Firebase.
Do not use this for logging unique values or identifiers as it has indexing limitations.
Useful for storing performance metrics in a database.
Functions
Caller manages the instance of the Measure. Must be enabled by a prefix in order to run real measurements. Instance is not held by the SharedPerformance object.
Run a single block of code with the Measure. Must be enabled by a prefix in order to run real measurements. Instance is not held by the SharedPerformance object.
Run a block of code only if the prefix is enabled. Returns the result of the block if the prefix is enabled, otherwise null.