Skip to content

Commit

Permalink
Make sure to set the latency send date when starting the monitor. (#630)
Browse files Browse the repository at this point in the history
Required:

Task/Issue URL: https://app.asana.com/0/0/1206412872188595/f
iOS PR: duckduckgo/iOS#2368
macOS PR: duckduckgo/macos-browser#2103
What kind of version bump will this require?: Patch

Description:

This PR fixes a bug in the latency monitor. See parent task for more info.
  • Loading branch information
samsymons committed Jan 24, 2024
1 parent 1d3a891 commit 75bb9be
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public actor NetworkProtectionLatencyMonitor {
public func start(serverIP: IPv4Address, callback: @escaping (Result) -> Void) {
os_log("⚫️ Starting latency monitor", log: .networkProtectionLatencyMonitorLog)

lastLatencyReported = Date()

latencyCancellable = latencySubject.eraseToAnyPublisher()
.receive(on: DispatchQueue.main)
.scan(ExponentialGeometricAverage()) { measurements, latency in
Expand Down

0 comments on commit 75bb9be

Please sign in to comment.