MetricsSystem
public enum MetricsSystem
The MetricsSystem is a global facility where the default metrics backend implementation (MetricsFactory) can be
configured. MetricsSystem is set up just once in a given program to set up the desired metrics backend
implementation.
-
Acquire a writer lock for the duration of the given block.
Declaration
Swift
public static func withWriterLock<T>(_ body: () throws -> T) rethrows -> TParameters
bodyThe block to execute while holding the lock.
Return Value
The value returned by the block.
-
bootstrapis an one-time configuration function which globally selects the desired metrics backend implementation.bootstrapcan be called at maximum once in any given program, calling it more than once will lead to undefined behaviour, most likely a crash.Declaration
Swift
public static func bootstrap(_ factory: MetricsFactory)Parameters
factoryA factory that given an identifier produces instances of metrics handlers such as
CounterHandler,RecorderHandlerandTimerHandler. -
Returns a reference to the configured factory.
Declaration
Swift
public static var factory: MetricsFactory { get }
View on GitHub
Install in Dash
MetricsSystem Enumeration Reference