Skip to content

Commit

Permalink
Add total hits to stdout; add is_cluster to results
Browse files Browse the repository at this point in the history
Signed-off-by: acarbonetto <[email protected]>
  • Loading branch information
acarbonetto committed Nov 9, 2023
1 parent 05c40cf commit 616c2a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public static Map<ChosenAction, LatencyResults> calculateResults(
SECONDS_IN_NANO * percentile(latencies, 50),
SECONDS_IN_NANO * percentile(latencies, 90),
SECONDS_IN_NANO * percentile(latencies, 99),
SECONDS_IN_NANO * stdDeviation(latencies, avgLatency)));
SECONDS_IN_NANO * stdDeviation(latencies, avgLatency),
latencies.size()));
}

return results;
Expand All @@ -116,6 +117,7 @@ public static void printResults(Map<ChosenAction, LatencyResults> resultsMap) {
System.out.println(action + " p90 latency in ms: " + results.p90Latency / 1000000.0);
System.out.println(action + " p99 latency in ms: " + results.p99Latency / 1000000.0);
System.out.println(action + " std dev in ms: " + results.stdDeviation / 1000000.0);
System.out.println(action + " total hits: " + results.totalHits);
}
}

Expand Down Expand Up @@ -195,6 +197,7 @@ public static void testClientSetGet(
JsonWriter.Write(
calculatedResults,
config.resultsFile.get(),
config.clusterModeEnabled,
dataSize,
clientCreator.get().getName(),
clientCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class JsonWriter {
public static void Write(
Map<ChosenAction, LatencyResults> calculatedResults,
String resultsFile,
boolean isCluster,
int dataSize,
String client,
int clientCount,
Expand All @@ -35,7 +36,7 @@ public static void Write(
}
var data =
new Measurements.MeasurementsBuilder()
// TODO: is_cluster
.is_cluster(isCluster)
.data_size(dataSize)
.client(client)
.client_count(clientCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ public class LatencyResults {
public final double p90Latency;
public final double p99Latency;
public final double stdDeviation;
public final int totalHits;

public LatencyResults(
double avgLatency,
double p50Latency,
double p90Latency,
double p99Latency,
double stdDeviation) {
double stdDeviation,
int totalHits) {
this.avgLatency = avgLatency;
this.p50Latency = p50Latency;
this.p90Latency = p90Latency;
this.p99Latency = p99Latency;
this.stdDeviation = stdDeviation;
this.totalHits = totalHits;
}
}

0 comments on commit 616c2a4

Please sign in to comment.