StatisticsConfigScope

class StatisticsConfigScope(var replay: Int = DEFAULT_REPLAY, var extraBufferCapacity: Int = DEFAULT_EXTRA_BUFFER_CAPACITY, var onBufferOverflow: BufferOverflow = DEFAULT_ON_BUFFER_OVERFLOW, var coroutineContext: CoroutineContext = DEFAULT_COROUTINE_CONTEXT, var enableDefaultCollector: Boolean = DEFAULT_ENABLE_DEFAULT_COLLECTOR, var defaultCollector: STAT_COLLECTOR_SCOPE = DEFAULT_COLLECTOR, var guaranteedSorted: Boolean = DEFAULT_GUARANTEED_SORTED) : StatisticsConfig

StatisticsConfigScope - Creating StatisticsConfig with Kotlin DSL style.

Constructors

Link copied to clipboard
constructor(replay: Int = DEFAULT_REPLAY, extraBufferCapacity: Int = DEFAULT_EXTRA_BUFFER_CAPACITY, onBufferOverflow: BufferOverflow = DEFAULT_ON_BUFFER_OVERFLOW, coroutineContext: CoroutineContext = DEFAULT_COROUTINE_CONTEXT, enableDefaultCollector: Boolean = DEFAULT_ENABLE_DEFAULT_COLLECTOR, defaultCollector: STAT_COLLECTOR_SCOPE = DEFAULT_COLLECTOR, guaranteedSorted: Boolean = DEFAULT_GUARANTEED_SORTED)

Properties

Link copied to clipboard

coroutineContext - context of coroutine for statistics.

Link copied to clipboard

defaultCollector - println base statistics to console if enableDefaultCollector is true.

Link copied to clipboard
open override var enableDefaultCollector: Boolean

enableDefaultCollector - flag for turn on defaultCollector, true for default.

Link copied to clipboard
open override var extraBufferCapacity: Int

extraBufferCapacity - the number of values buffered in addition to replay. Emit does not suspend while there is a buffer space remaining (optional, cannot be negative, defaults to zero).

Link copied to clipboard
val StatisticsConfig.flow: MutableSharedFlow<StatisticNote<Any?>>

Creates a new MutableSharedFlow for StatisticNote with StatisticsConfig params.

Link copied to clipboard
open override var guaranteedSorted: Boolean

Optimization flag for statistics. Default is false.

Link copied to clipboard

Creates a new CoroutineScope with SupervisorJob and StatisticsConfig.coroutineContext

Link copied to clipboard
open override var onBufferOverflow: BufferOverflow

onBufferOverflow - configures an emit action on buffer overflow. Optional, defaults to suspending attempts to emit a value. Values other than BufferOverflow. SUSPEND are supported only when replay 0 or extraBufferCapacity 0. Buffer overflow can happen only when there is at least one subscriber that is not ready to accept the new value. In the absence of subscribers only the most recent replay values are stored and the buffer overflow behavior is never triggered and has no effect.

Link copied to clipboard
open override var replay: Int

replay - the number of values replayed to new subscribers (cannot be negative, defaults to zero).