collectMetrics
fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.collectMetrics(metrics: DefaultMetrics<S, I, A>, name: String? = DefaultDecoratorName): Metrics
Install a new metricsDecorator
fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.collectMetrics(reportingScope: CoroutineScope, offloadContext: CoroutineContext = Dispatchers.Default, windowSeconds: Int = 60, emaAlpha: Double = 0.1, clock: Clock = Clock.System, bucketDuration: Duration = 1.seconds, timeSource: TimeSource = TimeSource.Monotonic, name: String? = DefaultDecoratorName): DefaultMetrics<S, I, A>
Create, install, and return a Metrics instance that will use the provided configuration to populate and produce pro.respawn.flowmvi.metrics.api.MetricsSnapshots.
For the explanation of the parameters, see metrics.
To understand how to collect metrics, see Metrics interface definition.
Do NOT pass the same or short-lived reportingScope to this method. The scope should have a longer lifetime to reliably collect metrics while the store is closed or restarted. More details are in the metrics definition