Skip to content

[Refactor] EventSource in Load Test Page to Singleton Pattern #101

Description

@haerim-kweon

refactor request

TODO

  • Refactor Load Test page to use a singleton pattern for EventSource.
  • Prevent multiple EventSource instances from being created during re-renders or tab switches.
  • Add proper lifecycle handling (e.g., connect once, close on unmount).

Describe Solution

Currently, the Load Test page creates a new EventSource instance each time the component is mounted or re-rendered, which may cause duplicate event listeners or memory leaks.

To resolve this, we should refactor the EventSource connection logic to follow the singleton pattern. This ensures that only one connection exists across the application lifecycle unless explicitly reset.

The singleton instance can be created in a utility module and shared across consumers. It should also handle reconnections or clean-up when needed.

Additional Info

  • Related to performance and network efficiency on long-running load tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions