Skip to content

Commit

Permalink
Remove duplicates. Reorganize and fix imports.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Oct 25, 2023
1 parent a2c2670 commit 4b9f8de
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 288 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import java.util.Arrays;
import java.util.Optional;
import java.util.stream.Stream;
import javababushka.benchmarks.clients.JedisClient;
import javababushka.benchmarks.clients.JedisPseudoAsyncClient;
import javababushka.benchmarks.clients.JniSyncClient;
import javababushka.benchmarks.clients.LettuceAsyncClient;
import javababushka.benchmarks.clients.LettuceClient;
import javababushka.benchmarks.clients.babushka.JniSyncClient;
import javababushka.benchmarks.clients.jedis.JedisClient;
import javababushka.benchmarks.clients.jedis.JedisPseudoAsyncClient;
import javababushka.benchmarks.clients.lettuce.LettuceAsyncClient;
import javababushka.benchmarks.clients.lettuce.LettuceClient;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
Expand Down
13 changes: 0 additions & 13 deletions java/benchmarks/src/main/java/javababushka/benchmarks/Client.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package javababushka.benchmarks.clients;
package javababushka.benchmarks.clients.babushka;

import java.io.IOException;
import java.net.StandardProtocolFamily;
Expand All @@ -8,6 +8,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javababushka.benchmarks.clients.SyncClient;
import javababushka.benchmarks.utils.ConnectionSettings;
import javababushka.client.RedisClient;
import org.apache.commons.lang3.tuple.MutablePair;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package javababushka.benchmarks.clients;
package javababushka.benchmarks.clients.jedis;

import javababushka.benchmarks.clients.SyncClient;
import javababushka.benchmarks.utils.ConnectionSettings;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
Expand Down Expand Up @@ -39,7 +40,6 @@ public void connectToRedis(ConnectionSettings connectionSettings) {
if (!jedisResource.isConnected()) {
throw new RuntimeException("failed to connect to jedis");
}
String info_result = info();
}

public String info() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package javababushka.benchmarks.clients;
package javababushka.benchmarks.clients.jedis;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import javababushka.benchmarks.clients.AsyncClient;

/**
* A jedis client with pseudo-sync capabilities. Jedis doesn't provide async API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package javababushka.benchmarks.clients;
package javababushka.benchmarks.clients.lettuce;

import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisFuture;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.async.RedisAsyncCommands;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import javababushka.benchmarks.clients.AsyncClient;
import javababushka.benchmarks.utils.ConnectionSettings;

/** A Lettuce client with async capabilities see: https://lettuce.io/ */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package javababushka.benchmarks.clients;
package javababushka.benchmarks.clients.lettuce;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisStringCommands;
import javababushka.benchmarks.clients.SyncClient;
import javababushka.benchmarks.utils.ConnectionSettings;

/** A Lettuce client with sync capabilities see: https://lettuce.io/ */
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javababushka.benchmarks.clients.jedis.JedisClient;
import javababushka.benchmarks.utils.Benchmarking;
import javababushka.benchmarks.utils.ChosenAction;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -23,12 +25,6 @@ static void initializeJedisClient() {
jedisClient.connectToRedis();
}

@Test
public void someLibraryMethodReturnsTrue() {
JedisClient classUnderTest = new JedisClient();
assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'");
}

@Test
public void testResourceInfo() {
String result = jedisClient.info();
Expand Down Expand Up @@ -56,7 +52,7 @@ public void testResourceSetGet() {
ChosenAction.GET_NON_EXISTING, () -> jedisClient.get(Benchmarking.generateKeyGet()));
actions.put(ChosenAction.SET, () -> jedisClient.set(Benchmarking.generateKeySet(), value));

Map<ChosenAction, ArrayList<Long>> latencies =
Map<ChosenAction, List<Long>> latencies =
Map.of(
ChosenAction.GET_EXISTING, new ArrayList<>(),
ChosenAction.GET_NON_EXISTING, new ArrayList<>(),
Expand All @@ -66,6 +62,6 @@ public void testResourceSetGet() {
latencies.get(latency.getKey()).add(latency.getValue());
}

Benchmarking.printResults(Benchmarking.calculateResults(latencies));
Benchmarking.printResults(Benchmarking.calculateResults(latencies), 0, iterations);
}
}
Loading

0 comments on commit 4b9f8de

Please sign in to comment.