UuidMetricType

public class UuidMetricType

This implements the developer facing API for recording UUID metrics.

Instances of this class type are automatically generated by the parsers at build time, allowing developers to record values that were previously registered in the metrics.yaml file.

The UUID API only exposes the UuidMetricType.generateAndSet() and UuidMetricType.set(_:) methods, which takes care of validating the input data and making sure that limits are enforced.

  • The public constructor used by automatically generated metrics.

    Declaration

    Swift

    public init(_ meta: CommonMetricData)
  • Generate a new UUID and set it in the metric store.

    Declaration

    Swift

    @discardableResult
    public func generateAndSet() -> UUID

    Return Value

    The UUID that was generated or nil if disabled.

  • Explicitly set an existing UUID value.

    Declaration

    Swift

    public func set(_ value: UUID)

    Parameters

    value

    A valid UUID to set the metric to.

  • Returns the stored value for testing purposes only. This function will attempt to await the last task (if any) writing to the the metric’s storage engine before returning a value.

    Declaration

    Swift

    public func testGetValue(_ pingName: String? = nil) -> UUID?

    Parameters

    pingName

    represents the name of the ping to retrieve the metric for. Defaults to the first value in sendInPings.

    Return Value

    value of the stored metric