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 test clients for benchmarking. #632

Conversation

Yury-Fridlyand
Copy link
Collaborator

Issue #, if available:
Part 3 of 4. (see #629)

Description of changes:
This PR contains testing clients for #629. Depends on #629 and #631 - some code is commented out. Should be merged after these PRs!

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Yury-Fridlyand Yury-Fridlyand added the java issues and fixes related to the java client label Nov 22, 2023
@Yury-Fridlyand
Copy link
Collaborator Author

Add client timeout as requiested in #629 (comment)

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand
Copy link
Collaborator Author

Add client timeout as requiested in #629 (comment)

Fixed in 07cfd8b

Signed-off-by: Yury-Fridlyand <[email protected]>
@@ -0,0 +1,50 @@
package javababushka.benchmarks.clients.babushka;

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Commented out for this PR.
Will be included as part of #631

@barshaul
Copy link
Collaborator

Hey @Yury-Fridlyand, the tests are failing and the PR is still marked as 'draft' - so let me know when it's ready for review

@Yury-Fridlyand
Copy link
Collaborator Author

Hey @Yury-Fridlyand, the tests are failing and the PR is still marked as 'draft' - so let me know when it's ready for review

Marked as draft to prevent merge, but it is ready for review. I'll update this PR once #629 and #631 merged.

acarbonetto and others added 4 commits November 27, 2023 12:51
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
@barshaul
Copy link
Collaborator

barshaul commented Dec 5, 2023

@Yury-Fridlyand Please rebase over the changes from #629, there is an overlap with this two PRs which makes it hard to understand what needs to be reviewed. Ping me when it's rebased and ready for review

@Yury-Fridlyand Yury-Fridlyand marked this pull request as ready for review December 7, 2023 01:59
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner December 7, 2023 01:59
@Yury-Fridlyand
Copy link
Collaborator Author

@barshaul, ready for review

@@ -97,7 +93,7 @@ private static Options getOptions() {
.hasArg(true)
.desc(
"one of:"
+ " all|jedis|jedis_async|lettuce|lettuce_async|babushka_async|all_async|all_sync"
+ " all|jedis|lettuce|lettuce_async|babushka_async|all_async|all_sync"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented on prev PR - make sure to rebase over the changes commited there

java/README.md Outdated
The Java client contains the following parts:

1. A Java client (lib folder): wrapper to rust-client.
2. An examples script: to sanity test babushka and similar java-clients against a redis host.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find this script?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we don't want the examples folder to contain examples of other clients, only babushka

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not exist yet (as well as the client itself)
Updated in 3e0f70b.

java/README.md Outdated

1. A Java client (lib folder): wrapper to rust-client.
2. An examples script: to sanity test babushka and similar java-clients against a redis host.
3. A benchmark app: to performance benchmark test babushka and similar java-clients against a redis host.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A benchmark app: A dedicated benchmarking tool designed to evaluate and compare the performance of Babushka and other Java clients.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 3e0f70b

java/README.md Outdated
* `port`: redis server port number
* `tls`: redis TLS configured

### Troubleshooting
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already commented for Andrew PR, it isn't specific for the Java wrapper, please remove it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 3e0f70b.

java/README.md Outdated
@@ -109,3 +115,18 @@ You can run benchmarks using `./gradlew run`. You can set arguments using the ar
./gradlew run --args="-help"
./gradlew run --args="-resultsFile=output -dataSize \"100 1000\" -concurrentTasks \"10 100\" -clients all -host localhost -port 6279 -clientCount \"1 5\" -tls"
```

The following arguments are accepted:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding it to the README file will require to maintain it when the benchmark app will be changed. It's enough to describe the different options in the -help option

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but benchmarking apps are not supposed to be updated.

Copy link
Collaborator

@barshaul barshaul Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do plan to add more arguments in the future (e.g. data value, command type, changing the ratio of set/get etc...)

@Override
public void connectToRedis(ConnectionSettings connectionSettings) {
pool =
new JedisPool(connectionSettings.host, connectionSettings.port, connectionSettings.useSsl);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're not testing Jedis in a cluster mode at all, redis cluster should be used with JedisCluster

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3e0f70b.


/*

public class JniNettyClient implements SyncClient, AsyncClient<Response> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove it from this PR and add it when the java-babushka will be added

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 3e0f70b.

private static JedisClient jedisClient;

@BeforeAll
static void initializeJedisClient() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we don't want to have other clients tests in our project, keeping them in the benchmark is enough. @shachlanAmazon what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely. Jedis & Lettuce can test themselves, we don't need to test them. And we don't test the benchmark, just like we don't test our tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove these tests now. I agree that they no longer add any value to our clients.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 3e0f70b.

private static LettuceAsyncClient otherLettuceClient;

@BeforeAll
static void initializeLettuceClient() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same - other clients tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 3e0f70b.

…ilestone-1-benchmarking-clients

Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
private StatefulRedisClusterConnection<String, String> clusterConnection;

@Override
public void connectToRedis(ConnectionSettings connectionSettings) {
Copy link
Collaborator

@barshaul barshaul Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yury-Fridlyand I think that the same as you did for Jedis, no need to have a separate file for LettuceClusterClient, you can use LettuceAsyncClient both for standalone and cluster

java/README.md Outdated
The Java client contains the following parts:

1. A Java client (lib folder): wrapper to rust client.
2. An examples script: to sanity test babushka against a Redis host.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example script would probably be with the rest examples under examples/ folder, so we don't need to specify it here. Lets remove number 2

Copy link
Collaborator

@barshaul barshaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the last comments, squash commits & ship it

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand merged commit 42243dc into valkey-io:main Dec 11, 2023
3 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the integ-java-client-milestone-1-benchmarking-clients branch December 11, 2023 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants