diff --git a/README.md b/README.md index 5775709..105da4d 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ If you have a server-side Swift application, or maybe a cross-platform (e.g. Lin To add a dependency on the metrics API package, you need to declare it in your `Package.swift`: ```swift -// it's early days here so we haven't tagged a version yet, but will soon -.package(url: "https://github.com/apple/swift-metrics.git", .branch("master")), +// SwiftMetrics is converging towards the 1.0.0 release as of April 22nd 2019, the tag is 1.0.0-convergence.1 +// To depend on this release, you can use +.package(url: "https://github.com/apple/swift-metrics.git", from: "1.0.0-convergence.1"), ``` and to your application/library target, add "Metrics" to your dependencies: @@ -46,9 +47,9 @@ Note: If you are building a library, you don't need to concern yourself with thi SwiftMetrics only provides the metrics system API. As an application owner, you need to select a metrics backend (such as the ones mentioned above) to make the metrics information useful. -Selecting a backend is done by adding a dependency on the desired backend client implementation and invoking the `MetricsSystem.bootstrap` function at the beginning of the program: +Selecting a backend is done by adding a dependency on the desired backend client implementation and invoking the `MetricsSystem.bootstrap` function at the beginning of the program: -```swift +```swift MetricsSystem.bootstrap(SelectedMetricsImplementation()) ``` @@ -192,7 +193,7 @@ class SimpleMetricsLibrary: MetricsFactory { func makeTimer(label: String, dimensions: [(String, String)]) -> TimerHandler { return ExampleTimer(label, dimensions) } - + // implementation is stateless, so nothing to do on destroy calls func destroyCounter(_ handler: CounterHandler) {} func destroyRecorder(_ handler: RecorderHandler) {} diff --git a/Sources/CoreMetrics/Metrics.swift b/Sources/CoreMetrics/Metrics.swift index fee58a6..7ade116 100644 --- a/Sources/CoreMetrics/Metrics.swift +++ b/Sources/CoreMetrics/Metrics.swift @@ -78,7 +78,6 @@ public class Counter { public func reset() { self.handler.reset() } - } public extension Counter { @@ -483,7 +482,6 @@ public final class MultiplexMetricsHandler: MetricsFactory { } } - private class MuxCounter: CounterHandler { let counters: [CounterHandler] public init(factories: [MetricsFactory], label: String, dimensions: [(String, String)]) { @@ -528,7 +526,6 @@ public final class MultiplexMetricsHandler: MetricsFactory { /// Ships with the metrics module, used for initial bootstraping. public final class NOOPMetricsHandler: MetricsFactory, CounterHandler, RecorderHandler, TimerHandler { - public static let instance = NOOPMetricsHandler() private init() {} @@ -543,9 +540,9 @@ public final class NOOPMetricsHandler: MetricsFactory, CounterHandler, RecorderH return self } - public func destroyCounter(_ handler: CounterHandler) {} - public func destroyRecorder(_ handler: RecorderHandler) {} - public func destroyTimer(_ handler: TimerHandler) {} + public func destroyCounter(_: CounterHandler) {} + public func destroyRecorder(_: RecorderHandler) {} + public func destroyTimer(_: TimerHandler) {} public func increment(by: Int64) {} public func reset() {}