@@ -18,16 +18,7 @@ public final class TestResult {
1818 @ JsonProperty ("concurrency" )
1919 public int concurrency = 1 ;
2020
21- @ JsonProperty ("put_latency_ms" )
22- public double putLatencyMs ;
23-
24- @ JsonProperty ("get_latency_ms" )
25- public double getLatencyMs ;
26-
27- @ JsonProperty ("end_to_end_latency_ms" )
28- public double endToEndLatencyMs ;
29-
30- @ JsonProperty ("ops_per_second" )
21+ @ JsonProperty ("operations_per_second" )
3122 public double opsPerSecond ;
3223
3324 @ JsonProperty ("bytes_per_second" )
@@ -39,14 +30,23 @@ public final class TestResult {
3930 @ JsonProperty ("memory_efficiency_ratio" )
4031 public double memoryEfficiencyRatio ;
4132
42- @ JsonProperty ("p50_latency" )
43- public double p50Latency ;
33+ @ JsonProperty ("avg_latency_ms" )
34+ public double avgLatencyMs ;
35+
36+ @ JsonProperty ("p50_latency_ms" )
37+ public double p50LatencyMs ;
4438
45- @ JsonProperty ("p95_latency " )
46- public double p95Latency ;
39+ @ JsonProperty ("p95_latency_ms " )
40+ public double p95LatencyMs ;
4741
48- @ JsonProperty ("p99_latency" )
49- public double p99Latency ;
42+ @ JsonProperty ("p99_latency_ms" )
43+ public double p99LatencyMs ;
44+
45+ @ JsonProperty ("encrypt_latency_ms" )
46+ public double encryptLatencyMs ;
47+
48+ @ JsonProperty ("decrypt_latency_ms" )
49+ public double decryptLatencyMs ;
5050
5151 @ JsonProperty ("timestamp" )
5252 public String timestamp = "" ;
@@ -88,24 +88,29 @@ public static TestResult createThroughputResult(
8888 result .concurrency = 1 ;
8989 result .opsPerSecond = opsPerSecond ;
9090 result .bytesPerSecond = opsPerSecond * dataSize ;
91- result .endToEndLatencyMs = avgTotalLatency ;
92- result .p50Latency = calculatePercentile (totalLatencies , 50 );
93- result .p95Latency = calculatePercentile (totalLatencies , 95 );
94- result .p99Latency = calculatePercentile (totalLatencies , 99 );
95- result .putLatencyMs = putLatencies
96- .stream ()
97- .mapToDouble (Double ::doubleValue )
98- .average ()
99- .orElse (0.0 );
100- result .getLatencyMs = getLatencies
101- .stream ()
102- .mapToDouble (Double ::doubleValue )
103- .average ()
104- .orElse (0.0 );
91+ result .avgLatencyMs = avgTotalLatency ;
92+ result .p50LatencyMs = calculatePercentile (totalLatencies , 50 );
93+ result .p95LatencyMs = calculatePercentile (totalLatencies , 95 );
94+ result .p99LatencyMs = calculatePercentile (totalLatencies , 99 );
95+ result .encryptLatencyMs =
96+ putLatencies
97+ .stream ()
98+ .mapToDouble (Double ::doubleValue )
99+ .average ()
100+ .orElse (0.0 );
101+ result .decryptLatencyMs =
102+ getLatencies
103+ .stream ()
104+ .mapToDouble (Double ::doubleValue )
105+ .average ()
106+ .orElse (0.0 );
105107 result .iterations = putLatencies .size ();
106- result .timestamp = java .time .LocalDateTime
107- .now ()
108- .format (java .time .format .DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" ));
108+ result .timestamp =
109+ java .time .LocalDateTime
110+ .now ()
111+ .format (
112+ java .time .format .DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" )
113+ );
109114 result .javaVersion = System .getProperty ("java.version" );
110115 result .cpuCount = cpuCount ;
111116 result .totalMemoryGb = totalMemoryMB / 1024.0 ;
@@ -130,9 +135,12 @@ public static TestResult createMemoryResult(
130135 result .concurrency = 1 ;
131136 result .peakMemoryMb = peakMemoryMb ;
132137 result .memoryEfficiencyRatio = memoryEfficiency ;
133- result .timestamp = java .time .LocalDateTime
134- .now ()
135- .format (java .time .format .DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" ));
138+ result .timestamp =
139+ java .time .LocalDateTime
140+ .now ()
141+ .format (
142+ java .time .format .DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" )
143+ );
136144 result .javaVersion = System .getProperty ("java.version" );
137145 result .cpuCount = cpuCount ;
138146 result .totalMemoryGb = totalMemoryMB / 1024.0 ;
@@ -153,23 +161,24 @@ public static TestResult createConcurrentResult(
153161 .mapToDouble (Double ::doubleValue )
154162 .average ()
155163 .orElse (0.0 );
156- final double totalTimeSeconds = allTimes
157- .stream ()
158- .mapToDouble (Double ::doubleValue )
159- .sum () / 1000.0 ;
160- final double opsPerSecond = totalTimeSeconds > 0 ? totalOps / totalTimeSeconds : 0.0 ;
164+ final double opsPerSecond =
165+ totalOps /
166+ (allTimes .stream ().mapToDouble (Double ::doubleValue ).sum () / 1000.0 );
161167
162168 final var result = new TestResult ();
163169 result .testName = "concurrent" ;
164170 result .dataSize = dataSize ;
165171 result .concurrency = concurrency ;
166172 result .opsPerSecond = opsPerSecond ;
167173 result .bytesPerSecond = opsPerSecond * dataSize ;
168- result .endToEndLatencyMs = avgLatency ;
174+ result .avgLatencyMs = avgLatency ;
169175 result .iterations = totalOps ;
170- result .timestamp = java .time .LocalDateTime
171- .now ()
172- .format (java .time .format .DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" ));
176+ result .timestamp =
177+ java .time .LocalDateTime
178+ .now ()
179+ .format (
180+ java .time .format .DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" )
181+ );
173182 result .javaVersion = System .getProperty ("java.version" );
174183 result .cpuCount = cpuCount ;
175184 result .totalMemoryGb = totalMemoryMB / 1024.0 ;
@@ -187,4 +196,4 @@ private static double calculatePercentile(
187196 final int clampedIndex = Math .max (0 , Math .min (index , values .size () - 1 ));
188197 return values .get (clampedIndex );
189198 }
190- }
199+ }
0 commit comments