Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid sending latency immediately after the monitor starts #630

Merged

Conversation

samsymons
Copy link
Contributor

@samsymons samsymons commented Jan 22, 2024

Please review the release process for BrowserServicesKit here.

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.

Steps to test this PR:

  1. Check out this branch and set it up in each of the client apps, but put an extra log in NetworkProtectionLatencyMonitor line 117 to print when the app is reporting latency back
  2. Change the let reportThreshold: TimeInterval line to use 1 minute instead of 10 minutes
  3. Run NetP and check that the app does not report latency immediately
  4. Wait 1 minute
  5. Check that you get a log that latency has been reported

If you want to test this behaviour before, simply comment out line 95 and test again - you will see that the app is sending its very first measurement as a pixel, instead of collecting an average.

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

Otherwise, the app would think it needs to send its very first latency measurement after starting up, which won’t necessarily be a good representation of the quality.
Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described.

@samsymons samsymons merged commit 08a05ac into main Jan 23, 2024
6 checks passed
@samsymons samsymons deleted the sam/avoid-sending-first-latency-measurement-as-pixel branch January 23, 2024 05:01
samsymons added a commit to duckduckgo/iOS that referenced this pull request Jan 23, 2024
samsymons added a commit to duckduckgo/macos-browser that referenced this pull request Jan 23, 2024
samsymons added a commit that referenced this pull request Jan 24, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants