Skip to content

Commit fd4a69c

Browse files
authored
Explicitly mark throughput as throughput; introduce goodput. (#102)
Explicitly mark throughput as throughput; introduce goodput. This clarifies that the former requests/second number reported is a true measure of the requests per second, i.e., it includes rejected and aborted transactions. Specifically, the former results string Results(nanoSeconds=XXX, measuredRequests=XXX) = XXX.XXX requests/sec is now of the form Results(nanoSeconds=XXX, measuredRequests=XXX) = XXX.XXX requests/sec (throughput), XXX.XXX requests/sec (goodput) where goodput is reported as the number of completed transactions. We also write an additional Goodput line to the summary file generated.
1 parent 8770f8b commit fd4a69c

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/main/java/com/oltpbenchmark/Results.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ public Map<TransactionType, Histogram<String>> getAbortMessages() {
8686
return abortMessages;
8787
}
8888

89-
public double requestsPerSecond() {
89+
public double requestsPerSecondThroughput() {
9090
return (double) measuredRequests / (double) nanoseconds * 1e9;
9191
}
9292

93+
public double requestsPerSecondGoodput() {
94+
return (double) success.getSampleCount() / (double) nanoseconds * 1e9;
95+
}
96+
9397
public List<Sample> getLatencySamples() {
9498
return latencySamples;
9599
}
@@ -104,9 +108,19 @@ public int getMeasuredRequests() {
104108

105109
@Override
106110
public String toString() {
107-
return "Results(nanoSeconds=" + nanoseconds + ", measuredRequests=" + measuredRequests + ") = " + requestsPerSecond() + " requests/sec";
111+
StringBuilder sb = new StringBuilder();
112+
sb.append("Results(nanoSeconds=");
113+
sb.append(nanoseconds);
114+
sb.append(", measuredRequests=");
115+
sb.append(measuredRequests);
116+
sb.append(") = ");
117+
sb.append(requestsPerSecondThroughput());
118+
sb.append(" requests/sec (throughput)");
119+
sb.append(", ");
120+
sb.append(requestsPerSecondGoodput());
121+
sb.append(" requests/sec (goodput)");
122+
return sb.toString();
108123
}
109124

110125

111-
112126
}

src/main/java/com/oltpbenchmark/util/ResultWriter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public void writeSummary(PrintStream os) {
107107
summaryMap.put("DBMS Version", collector.collectVersion());
108108
summaryMap.put("Benchmark Type", benchType);
109109
summaryMap.put("Latency Distribution", results.getDistributionStatistics().toMap());
110-
summaryMap.put("Throughput (requests/second)", results.requestsPerSecond());
110+
summaryMap.put("Throughput (requests/second)", results.requestsPerSecondThroughput());
111+
summaryMap.put("Goodput (requests/second)", results.requestsPerSecondGoodput());
111112
for (String field : BENCHMARK_KEY_FIELD) {
112113
summaryMap.put(field, expConf.getString(field));
113114
}

0 commit comments

Comments
 (0)