Skip to content

Commit 00dcfe1

Browse files
author
Ignacio Bonafonte
authored
Merge branch 'main' into network-info
2 parents 2fa0125 + 4610d6e commit 00dcfe1

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let package = Package(
5050
.package(name: "grpc-swift", url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0"),
5151
.package(name: "swift-atomics", url: "https://github.com/apple/swift-atomics.git", from: "0.0.1"),
5252
.package(name: "swift-metrics", url: "https://github.com/apple/swift-metrics.git", from: "2.1.1"),
53-
.package(name: "Reachability", url: "https://github.com/ashleymills/Reachability.swift", .branch("master")),
53+
.package(name: "Reachability", url: "https://github.com/ashleymills/Reachability.swift", from: "5.1.0"),
5454

5555
],
5656
targets: [

Sources/Instrumentation/NetworkStatus/NetworkMonitor.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import Foundation
77
import Reachability
88

9-
public class NetworkMonitor : NetworkMonitorProtocol {
10-
public private(set) var reachability :Reachability
11-
9+
public class NetworkMonitor: NetworkMonitorProtocol {
10+
public private(set) var reachability: Reachability
11+
1212
public init() throws {
1313
reachability = try Reachability()
1414
try reachability.startNotifier()
@@ -17,17 +17,15 @@ public class NetworkMonitor : NetworkMonitorProtocol {
1717
deinit {
1818
reachability.stopNotifier()
1919
}
20-
20+
2121
public func getConnection() -> Connection {
2222
switch reachability.connection {
2323
case .wifi:
2424
return .wifi
2525
case .cellular:
2626
return .cellular
27-
case .unavailable:
27+
case .unavailable, .none:
2828
return .unavailable
2929
}
3030
}
31-
32-
3331
}

Sources/OpenTelemetrySdk/Resources/Resource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ public struct Resource: Equatable, Hashable {
4040
}
4141

4242
/// Modifies the current Resource by merging with the other Resource.
43-
/// In case of a collision, current Resource takes precedence.
43+
/// In case of a collision, new Resource takes precedence.
4444
/// - Parameter other: the Resource that will be merged with this
4545
public mutating func merge(other: Resource) {
4646
attributes.merge(other.attributes) { _, other in other }
4747
}
4848

4949
/// Returns a new, merged Resource by merging the current Resource with the other Resource.
50-
/// In case of a collision, current Resource takes precedence.
50+
/// In case of a collision, new Resource takes precedence.
5151
/// - Parameter other: the Resource that will be merged with this
5252
public func merging(other: Resource) -> Resource {
5353
let labelsCopy = attributes.merging(other.attributes) { _, other in other }

0 commit comments

Comments
 (0)