|
12 | 12 |
|
13 | 13 | using StackExchange.Redis;
|
14 | 14 |
|
| 15 | +using static Glide.ConnectionConfiguration; |
| 16 | + |
15 | 17 | public static class MainClass
|
16 | 18 | {
|
17 | 19 | private enum ChosenAction { GET_NON_EXISTING, GET_EXISTING, SET };
|
@@ -49,11 +51,6 @@ public class CommandLineOptions
|
49 | 51 |
|
50 | 52 | private static string GetAddressForStackExchangeRedis(string host, bool useTLS) => $"{GetAddress(host)},ssl={useTLS}";
|
51 | 53 |
|
52 |
| - private static string GetAddressWithRedisPrefix(string host, bool useTLS) |
53 |
| - { |
54 |
| - string protocol = useTLS ? "rediss" : "redis"; |
55 |
| - return $"{protocol}://{GetAddress(host)}"; |
56 |
| - } |
57 | 54 | private const double PROB_GET = 0.8;
|
58 | 55 |
|
59 | 56 | private const double PROB_GET_EXISTING_KEY = 0.8;
|
@@ -95,7 +92,7 @@ private static double Percentile(double[] sequence, double excelPercentile)
|
95 | 92 | }
|
96 | 93 | }
|
97 | 94 |
|
98 |
| - private static double CalculateLatency(IEnumerable<double> latency_list, double percentile_point) => Math.Round(Percentile(latency_list.ToArray(), percentile_point), 2); |
| 95 | + private static double CalculateLatency(IEnumerable<double> latency_list, double percentile_point) => Math.Round(Percentile([.. latency_list], percentile_point), 2); |
99 | 96 |
|
100 | 97 | private static void PrintResults(string resultsFile)
|
101 | 98 | {
|
@@ -263,7 +260,9 @@ private static async Task RunWithParameters(int total_commands,
|
263 | 260 | {
|
264 | 261 | ClientWrapper[] clients = await CreateClients(clientCount, () =>
|
265 | 262 | {
|
266 |
| - BaseClient glide_client = new GlideClient(host, PORT, useTLS); |
| 263 | + StandaloneClientConfiguration config = new StandaloneClientConfigurationBuilder() |
| 264 | + .WithAddress(host, PORT).WithTls(useTLS).Build(); |
| 265 | + BaseClient glide_client = new GlideClient(config); |
267 | 266 | return Task.FromResult<(Func<string, Task<string?>>, Func<string, string, Task>, Action)>(
|
268 | 267 | (async (key) => await glide_client.Get(key),
|
269 | 268 | async (key, value) => await glide_client.Set(key, value),
|
|
0 commit comments