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

Refactor isRemoteBrowser check #889

Merged
merged 9 commits into from
May 23, 2023
Merged

Refactor isRemoteBrowser check #889

merged 9 commits into from
May 23, 2023

Commits on May 18, 2023

  1. Rename web vital metrics

    We're renaming them from webvital_xxx_xxx_xxx to browser_web_vital_xxx.
    This change benefits us in three ways:
    1. Browser metrics will be namespaced with browser_
    2. webvital is two words, so web vital
    3. We're assuming that users will have the context of web vital metrics
    so that we can use the abbreviations which also helps with the display
    of them at the end of the test run.
    
    Closes: #884
    ankur22 committed May 18, 2023
    Configuration menu
    Copy the full SHA
    5e77e5d View commit details
    Browse the repository at this point in the history
  2. Add a new remoteRegistry type

    This type will use env to retrieve the remote ws url details and
    whether one is supplied. It will store this data, which can then
    be retrieved when needed.
    ankur22 committed May 18, 2023
    Configuration menu
    Copy the full SHA
    646bec7 View commit details
    Browse the repository at this point in the history
  3. Update the module with a remoteRegistry

    Create a new instance of remoteRegistry which can be stored in the
    RootModule. This single instance of remoteRegistry can be set in all
    new ModuleInstances. Later on anything requiring the remoteRegistry
    should be able to access it to retrieve the remote ws url.
    ankur22 committed May 18, 2023
    Configuration menu
    Copy the full SHA
    803404b View commit details
    Browse the repository at this point in the history
  4. Update the mapping to work with remoteRegistry

    Now that the remoteRegistry is part of the ModuleInstance, we can
    retrieve the parsed data from the env var and use it when setting up
    the mapping for the current vu.
    ankur22 committed May 18, 2023
    Configuration menu
    Copy the full SHA
    b3b101f View commit details
    Browse the repository at this point in the history

Commits on May 22, 2023

  1. Fix random ws url selection

    When K6_BROWSER_WS_URL is a comma separated list of ws urls, we need
    to pick from the list every time remoteRegistry.IsRemoteBrowser is
    called, not just once when remoteRegistry is created. This change moves
    the round robin (with the use of rand) to remoteRegistry.Is...
    ...RemoteBrowser from env.IsRemoteBrowser. env.IsRemoteBrowser now
    only collects and returns the list of ws urls.
    ankur22 committed May 22, 2023
    Configuration menu
    Copy the full SHA
    a81d246 View commit details
    Browse the repository at this point in the history
  2. Refactor env to registry package

    Env package now contains one type that is specific to the environment.
    The registry package contains changes which are specific to retrieving
    the remote ws urls. So this commit splits the two different concerns.
    A future commit with also move the remote registry specific logic from
    the browser package into the registry package.
    ankur22 committed May 22, 2023
    Configuration menu
    Copy the full SHA
    0a49751 View commit details
    Browse the repository at this point in the history
  3. Move remote registry logic into remote package

    To encapsulate the remote registry logic, we've moved the remote
    registry logic from the browser package into the remote package.
    ankur22 committed May 22, 2023
    Configuration menu
    Copy the full SHA
    670d249 View commit details
    Browse the repository at this point in the history
  4. Refactor pkg IsRemoteBrowser into New method

    We no longer need to expose the pkg scoped IsRemoteBrowser since the
    only thing calling it is NewRemoteRegistry. The logic has been moved
    into NewRemoteRegistry.
    ankur22 committed May 22, 2023
    Configuration menu
    Copy the full SHA
    df397e5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6d87e37 View commit details
    Browse the repository at this point in the history