diff --git a/Sources/CoreMetrics/Metrics.swift b/Sources/CoreMetrics/Metrics.swift index 998fbef..9c03a0a 100644 --- a/Sources/CoreMetrics/Metrics.swift +++ b/Sources/CoreMetrics/Metrics.swift @@ -36,17 +36,22 @@ public protocol CounterHandler: AnyObject { /// A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero. /// For example, you can use a counter to represent the number of requests served, tasks completed, or errors. -/// This is the user facing Counter API. Its behavior depends on the `CounterHandler` implementation. +/// +/// This is the user-facing Counter API. +/// +/// Its behavior depends on the `CounterHandler` implementation. public class Counter { @usableFromInline var handler: CounterHandler public let label: String public let dimensions: [(String, String)] - /// Create a new `Counter`. + /// Alternative way to create a new `Counter`, while providing an explicit `CounterHandler`. /// - /// This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one. - /// We do not expect this API to be used in normal circumstances, so if you find yourself using it make sure it's for a good reason. + /// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one. + /// We do not expect this API to be used in normal circumstances, so if you find yourself using it make sure it's for a good reason. + /// + /// - SeeAlso: Use `init(label:dimensions:)` to create `Counter` instances using the configured metrics backend. /// /// - parameters: /// - label: The label for the `Counter`. @@ -124,7 +129,10 @@ public protocol RecorderHandler: AnyObject { } /// A recorder collects observations within a time window (usually things like response sizes) and *can* provide aggregated information about the data sample, for example, count, sum, min, max and various quantiles. -/// This is the user facing Recorder API. Its behavior depends on the `RecorderHandler` implementation. +/// +/// This is the user-facing Recorder API. +/// +/// Its behavior depends on the `RecorderHandler` implementation. public class Recorder { @usableFromInline var handler: RecorderHandler @@ -132,10 +140,12 @@ public class Recorder { public let dimensions: [(String, String)] public let aggregate: Bool - /// Create a new `Recorder`. + /// Alternative way to create a new `Recorder`, while providing an explicit `RecorderHandler`. /// - /// This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one. - /// We do not expect this API to be used in normal circumstances, so if you find yourself using it make sure it's for a good reason. + /// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one. + /// We do not expect this API to be used in normal circumstances, so if you find yourself using it make sure it's for a good reason. + /// + /// - SeeAlso: Use `init(label:dimensions:)` to create `Recorder` instances using the configured metrics backend. /// /// - parameters: /// - label: The label for the `Recorder`. @@ -221,17 +231,22 @@ public protocol TimerHandler: AnyObject { /// A timer collects observations within a time window (usually things like request durations) and provides aggregated information about the data sample, /// for example, min, max and various quantiles. It is similar to a `Recorder` but specialized for values that represent durations. -/// This is the user facing Timer API. Its behavior depends on the `TimerHandler` implementation. +/// +/// This is the user-facing Timer API. +/// +/// Its behavior depends on the `TimerHandler` implementation. public class Timer { @usableFromInline var handler: TimerHandler public let label: String public let dimensions: [(String, String)] - /// Create a new `Timer`. + /// Alternative way to create a new `Timer`, while providing an explicit `TimerHandler`. /// - /// This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one. - /// We do not expect this API to be used in normal circumstances, so if you find yourself using it make sure it's for a good reason. + /// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one. + /// We do not expect this API to be used in normal circumstances, so if you find yourself using it make sure it's for a good reason. + /// + /// - SeeAlso: Use `init(label:dimensions:)` to create `Recorder` instances using the configured metrics backend. /// /// - parameters: /// - label: The label for the `Timer`. @@ -347,8 +362,8 @@ public extension Timer { /// * `Recorder` -> `RecorderHandler` /// * `Timer` -> `TimerHandler` /// -/// This type is an implementation detail and should not be used directly, unless implementing your own metrics backend. -/// To use the SwiftMetrics API, please refer to the documentation of `MetricsSystem`. +/// - warning: This type is an implementation detail and should not be used directly, unless implementing your own metrics backend. +/// To use the SwiftMetrics API, please refer to the documentation of `MetricsSystem`. /// /// # Destroying metrics ///