Skip to content

Commit 4c83e1c

Browse files
authored
Remove warnings against explicit dependency injection of the metrics factory (#174)
### Motivation: In the previous PR, we noticed that these warnings seem to discourage explicit dependency injection, but it's not clear why we should be discouraging it. ### Modifications: Removed the warning. ### Result: N/A
1 parent 98d3617 commit 4c83e1c

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

Sources/CoreMetrics/Metrics.swift

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public final class Counter {
3333

3434
/// Alternative way to create a new `Counter`, while providing an explicit `CounterHandler`.
3535
///
36-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
37-
/// 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.
38-
///
3936
/// - SeeAlso: Use `init(label:dimensions:)` to create `Counter` instances using the configured metrics backend.
4037
///
4138
/// - parameters:
@@ -52,9 +49,6 @@ public final class Counter {
5249

5350
/// Alternative way to create a new `Counter`, while providing an explicit `CounterHandler`.
5451
///
55-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
56-
/// 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.
57-
///
5852
/// - SeeAlso: Use `init(label:dimensions:)` to create `Counter` instances using the configured metrics backend.
5953
///
6054
/// - parameters:
@@ -147,9 +141,6 @@ public final class FloatingPointCounter {
147141

148142
/// Alternative way to create a new `FloatingPointCounter`, while providing an explicit `FloatingPointCounterHandler`.
149143
///
150-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
151-
/// 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.
152-
///
153144
/// - SeeAlso: Use `init(label:dimensions:)` to create `FloatingPointCounter` instances using the configured metrics backend.
154145
///
155146
/// - parameters:
@@ -171,9 +162,6 @@ public final class FloatingPointCounter {
171162

172163
/// Alternative way to create a new `FloatingPointCounter`, while providing an explicit `FloatingPointCounterHandler`.
173164
///
174-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
175-
/// 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.
176-
///
177165
/// - SeeAlso: Use `init(label:dimensions:)` to create `FloatingPointCounter` instances using the configured metrics backend.
178166
///
179167
/// - parameters:
@@ -287,9 +275,6 @@ public final class Meter {
287275

288276
/// Alternative way to create a new `Meter`, while providing an explicit `MeterHandler`.
289277
///
290-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
291-
/// 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.
292-
///
293278
/// - SeeAlso: Use `init(label:dimensions:)` to create `Meter` instances using the configured metrics backend.
294279
///
295280
/// - parameters:
@@ -306,9 +291,6 @@ public final class Meter {
306291

307292
/// Alternative way to create a new `Meter`, while providing an explicit `MeterHandler`.
308293
///
309-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
310-
/// 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.
311-
///
312294
/// - SeeAlso: Use `init(label:dimensions:)` to create `Meter` instances using the configured metrics backend.
313295
///
314296
/// - parameters:
@@ -422,9 +404,6 @@ public class Recorder {
422404

423405
/// Alternative way to create a new `Recorder`, while providing an explicit `RecorderHandler`.
424406
///
425-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
426-
/// 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.
427-
///
428407
/// - SeeAlso: Use `init(label:dimensions:)` to create `Recorder` instances using the configured metrics backend.
429408
///
430409
/// - parameters:
@@ -449,9 +428,6 @@ public class Recorder {
449428

450429
/// Alternative way to create a new `Recorder`, while providing an explicit `RecorderHandler`.
451430
///
452-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
453-
/// 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.
454-
///
455431
/// - SeeAlso: Use `init(label:dimensions:)` to create `Recorder` instances using the configured metrics backend.
456432
///
457433
/// - parameters:
@@ -594,9 +570,6 @@ public final class Timer {
594570

595571
/// Alternative way to create a new `Timer`, while providing an explicit `TimerHandler`.
596572
///
597-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
598-
/// 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.
599-
///
600573
/// - SeeAlso: Use `init(label:dimensions:)` to create `Recorder` instances using the configured metrics backend.
601574
///
602575
/// - parameters:
@@ -613,9 +586,6 @@ public final class Timer {
613586

614587
/// Alternative way to create a new `Timer`, while providing an explicit `TimerHandler`.
615588
///
616-
/// - warning: This initializer provides an escape hatch for situations where one must use a custom factory instead of the global one.
617-
/// 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.
618-
///
619589
/// - SeeAlso: Use `init(label:dimensions:)` to create `Recorder` instances using the configured metrics backend.
620590
///
621591
/// - parameters:
@@ -876,8 +846,7 @@ public enum MetricsSystem {
876846
/// * `Recorder` -> `RecorderHandler`
877847
/// * `Timer` -> `TimerHandler`
878848
///
879-
/// - warning: This type is an implementation detail and should not be used directly, unless implementing your own metrics backend.
880-
/// To use the SwiftMetrics API, please refer to the documentation of `MetricsSystem`.
849+
/// To use the SwiftMetrics API, please refer to the documentation of `MetricsSystem`.
881850
///
882851
/// # Destroying metrics
883852
///

0 commit comments

Comments
 (0)