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

Add event system for JS modules #3112

Merged
merged 12 commits into from
Jun 30, 2023
Merged

Add event system for JS modules #3112

merged 12 commits into from
Jun 30, 2023

Commits on Jun 30, 2023

  1. Add event system

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    b66f9d7 View commit details
    Browse the repository at this point in the history
  2. Expose event system to JS modules

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    be59f24 View commit details
    Browse the repository at this point in the history
  3. Emit events in run command and js.VU.RunOnce()

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    936999c View commit details
    Browse the repository at this point in the history
  4. Remove embedded context from event.System

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    3ed0ffc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    002947b View commit details
    Browse the repository at this point in the history
  6. Emit VU events in a VU-local event system

    This addresses the issue that made it difficult to keep track of events
    for a specific VU, since the browser module needs to initialize browser
    processes for each VU[1].
    
    This splits the event system into a global and local (per-VU) one, and
    the JS module can decide to which they want to subscribe to.
    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    d509983 View commit details
    Browse the repository at this point in the history
  7. Set a very high event wait timeout

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    31fedfb View commit details
    Browse the repository at this point in the history
  8. Wait for IterStart and IterEnd events to be processed

    The browser module uses the IterStart and IterEnd events for browser
    initialization and shutdown, so we need to wait for them to complete.
    There is some concern that this might add some delay to the overall
    iteration duration, and not just to the iterations where browsers
    processes are managed, but it should be negligible overall. We should
    run benchmarks after this change to confirm this.
    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    c11f0df View commit details
    Browse the repository at this point in the history
  9. DRY event emission, fix issue passing aborted error

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    babfba4 View commit details
    Browse the repository at this point in the history
  10. Initialize global event system in GlobalState, defer Exit emission ea…

    …rlier
    
    This ensures that the Exit event is sent even in the case of an early
    error, such as a script exception.
    
    Resolves #3112 (comment)
    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    bc88ce0 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f2e4a52 View commit details
    Browse the repository at this point in the history
  12. Address feedback from PR review

    Ivan Mirić committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    91fc97e View commit details
    Browse the repository at this point in the history