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.

  • bootstrap is an one-time configuration function which globally selects the desired metrics backend implementation. bootstrap can 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

    factory

    A factory that given an identifier produces instances of metrics handlers such as CounterHandler, RecorderHandler and TimerHandler.

  • Returns a reference to the configured factory.

    Declaration

    Swift

    public static var factory: MetricsFactory { get }