Skip to content

Commit

Permalink
Address PR feedback.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Nov 16, 2023
1 parent bb9097b commit 2f8f93a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
4 changes: 2 additions & 2 deletions benchmarks/utilities/csv_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
values = [json_object[field] for field in base_fields]
writer.writerow(values)

# for json_file_full_path in sys.argv[1:-1]:
# os.remove(json_file_full_path)
for json_file_full_path in sys.argv[1:-1]:
os.remove(json_file_full_path)
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ public static class RunConfiguration {

public RunConfiguration() {
configuration = "Release";
resultsFile = Optional.of("res_java.json"); // Optional.empty();
dataSize = new int[] {100};
concurrentTasks = new int[] {100};
resultsFile = Optional.empty();
dataSize = new int[] {100, 4000};
concurrentTasks = new int[] {100, 1000};
clients =
new ClientName[] {
// ClientName.BABUSHKA_ASYNC,
Expand All @@ -266,7 +266,7 @@ public RunConfiguration() {
};
host = "localhost";
port = 6379;
clientCount = new int[] {2};
clientCount = new int[] {1, 2};
tls = false;
clusterModeEnabled = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/** A Redis client with async capabilities */
public interface AsyncClient<T> extends Client {

long DEFAULT_TIMEOUT = 1000;
long DEFAULT_TIMEOUT_MILLISECOND = 1000;

Future<T> asyncConnectToRedis(ConnectionSettings connectionSettings);

Expand All @@ -16,7 +16,7 @@ public interface AsyncClient<T> extends Client {
Future<String> asyncGet(String key);

default <T> T waitForResult(Future<T> future) {
return waitForResult(future, DEFAULT_TIMEOUT);
return waitForResult(future, DEFAULT_TIMEOUT_MILLISECOND);
}

default <T> T waitForResult(Future<T> future, long timeout) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void closeConnection() {

@Override
public void connectToRedis() {
connectToRedis(new ConnectionSettings("localhost", 6379, false));
connectToRedis(new ConnectionSettings("localhost", 6379, false, false));
}

@Override
Expand All @@ -41,7 +41,7 @@ public void connectToRedis(ConnectionSettings connectionSettings) {
@Override
public Future<Response> asyncConnectToRedis(ConnectionSettings connectionSettings) {
return testClient.asyncConnectToRedis(
connectionSettings.host, connectionSettings.port, connectionSettings.useSsl, false);
connectionSettings.host, connectionSettings.port, connectionSettings.useSsl, connectionSettings.clusterMode);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class LettuceAsyncClient implements AsyncClient<String> {

@Override
public void connectToRedis() {
connectToRedis(new ConnectionSettings("localhost", 6379, false));
connectToRedis(new ConnectionSettings("localhost", 6379, false, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class LettuceAsyncClusterClient extends LettuceAsyncClient {

@Override
public void connectToRedis() {
connectToRedis(new ConnectionSettings("localhost", 6379, false));
connectToRedis(new ConnectionSettings("localhost", 6379, false, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LettuceClient implements SyncClient {

@Override
public void connectToRedis() {
connectToRedis(new ConnectionSettings("localhost", 6379, false));
connectToRedis(new ConnectionSettings("localhost", 6379, false, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static void testClientSetGet(
List<Client> clients = new LinkedList<>();
for (int cc = 0; cc < clientCount; cc++) {
Client newClient = clientCreator.get();
newClient.connectToRedis(new ConnectionSettings(config.host, config.port, config.tls));
newClient.connectToRedis(new ConnectionSettings(config.host, config.port, config.tls, config.clusterModeEnabled));
clients.add(newClient);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package javababushka.benchmarks.utils;

import lombok.AllArgsConstructor;

/** Redis-client settings */
@AllArgsConstructor
public class ConnectionSettings {
public String host;
public int port;
public boolean useSsl;

public ConnectionSettings(String host, int port, boolean useSsl) {
this.host = host;
this.port = port;
this.useSsl = useSsl;
}
public final String host;
public final int port;
public final boolean useSsl;
public final boolean clusterMode;
}

0 comments on commit 2f8f93a

Please sign in to comment.