-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: load balance test location in WPT (DELO-4766) #95
Merged
lukaszczerpak-cloudinary
merged 12 commits into
master
from
DELO-4766-load-balance-test-location-in-wpt
Dec 9, 2024
Merged
feat: load balance test location in WPT (DELO-4766) #95
lukaszczerpak-cloudinary
merged 12 commits into
master
from
DELO-4766-load-balance-test-location-in-wpt
Dec 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- introduced locations update timeout
wtp/apiCaller.js
Outdated
fvonly: 1, // first view only | ||
timeline: 1 // workaround for WPT sometimes hanging on getComputedStyle() | ||
}, | ||
headers: { 'User-Agent': 'WebSpeedTest', 'X-WPT-API-KEY': apiKey }, | ||
headers: { 'User-Agent': 'WebSpeedTest', 'X-WPT-API-KEY': apiKeys.get() }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe to keep the semantics of key
we could rename get
to getRandom()
or getKey()
if random is just an implementation detail..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, corrected as per suggestion
ikrascloudinary
approved these changes
Dec 9, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This feature introduces load-balancing across multiple WPT locations. The goal is to always choose least loaded region.
Please note that US-based regions are taken into consideration only.
The following configuration options are introduced:
WTP_LS_CACHE_TTL
(defaults:10
sec) - how long to cache locations and selected location;0
means we check best location on every test runWTP_LS_DEFAULT_LOCATION
(defaults:IAD_US_01
- which location to use in case there is a problem with API and there is nothing selected yetWTP_LS_UPDATE_TIMEOUT
- (defaults:20
sec) timeout for updating locationsAlso, for better insight there are two new endpoints (both responses served from local cache):
/locations
- prints out all locations we consider along with their metrics/locations/current
- identifier of the location we currently use as the best one