Skip to content

Commit 52e86db

Browse files
authored
Update swift-metrics SPI usage (#16)
* Update swift-metrics SPI usage Because of apple/swift-metrics@53be786 These projects are part of the same swift-metrics umbrella and are allowed to reach for this SPI, though it was not stable and it changed now. * update minimum swift-metrics requirement: 2.3.2 because SPI
1 parent 32c0d5a commit 52e86db

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let package = Package(
2222
.library(name: "MetricsTestUtils", targets: ["MetricsTestUtils"]),
2323
],
2424
dependencies: [
25-
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.1.1"),
25+
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.3.2"),
2626
],
2727
targets: [
2828
.target(

Sources/MetricsTestUtils/TestMetrics.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ extension TestMetrics {
149149
// MARK: Counter
150150

151151
public func expectCounter(_ metric: Counter) throws -> TestCounter {
152-
guard let counter = metric.handler as? TestCounter else {
153-
throw TestMetricsError.illegalMetricType(metric: metric.handler, expected: "\(TestCounter.self)")
152+
guard let counter = metric._handler as? TestCounter else {
153+
throw TestMetricsError.illegalMetricType(metric: metric._handler, expected: "\(TestCounter.self)")
154154
}
155155
return counter
156156
}
@@ -185,8 +185,8 @@ extension TestMetrics {
185185
// MARK: Recorder
186186

187187
public func expectRecorder(_ metric: Recorder) throws -> TestRecorder {
188-
guard let recorder = metric.handler as? TestRecorder else {
189-
throw TestMetricsError.illegalMetricType(metric: metric.handler, expected: "\(TestRecorder.self)")
188+
guard let recorder = metric._handler as? TestRecorder else {
189+
throw TestMetricsError.illegalMetricType(metric: metric._handler, expected: "\(TestRecorder.self)")
190190
}
191191
return recorder
192192
}
@@ -209,8 +209,8 @@ extension TestMetrics {
209209
// MARK: Timer
210210

211211
public func expectTimer(_ metric: CoreMetrics.Timer) throws -> TestTimer {
212-
guard let timer = metric.handler as? TestTimer else {
213-
throw TestMetricsError.illegalMetricType(metric: metric.handler, expected: "\(TestTimer.self)")
212+
guard let timer = metric._handler as? TestTimer else {
213+
throw TestMetricsError.illegalMetricType(metric: metric._handler, expected: "\(TestTimer.self)")
214214
}
215215
return timer
216216
}

0 commit comments

Comments
 (0)