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 BenchClient's implementation #486

Closed
Phoenix500526 opened this issue Oct 16, 2023 · 1 comment · Fixed by #496
Closed

Refactor BenchClient's implementation #486

Phoenix500526 opened this issue Oct 16, 2023 · 1 comment · Fixed by #496
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Phoenix500526
Copy link
Collaborator

Currently, for the BenchClient in Xline, we have the following implementation.

/// Benchmark client
pub(crate) struct BenchClient {
    /// Name of the client
    name: String,
    /// etcd client
    etcd_client: EtcdClient,
    /// xline client
    xline_client: Client,
    /// Use xline client to send requests when true
    use_curp_client: bool,
}

As you can see, a BenchClient owns two different inner clients, one is EtcdClient while the other is XlineClient. Since both clients are part of a BenchClient, we have to construct them simultaneously. However, this is not an efficient way in that we only need one specific client in any specific bench test. Therefore, we need to refactor this implementation and use an enumeration to wrap these two clients as another data structure.

@Phoenix500526 Phoenix500526 added enhancement New feature or request good first issue Good for newcomers labels Oct 16, 2023
@Kikkon
Copy link
Contributor

Kikkon commented Oct 20, 2023

😇 Let me try.

@Phoenix500526 Phoenix500526 linked a pull request Nov 7, 2023 that will close this issue
@mergify mergify bot closed this as completed in #496 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants