Skip to content

Commit

Permalink
Changed NatsBench csv mode to remove confusing message count
Browse files Browse the repository at this point in the history
Fixes #246
  • Loading branch information
Stephen Asbury committed Jun 17, 2019
1 parent fd18050 commit 74bf92e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/examples/java/io/nats/examples/benchmark/Benchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public final String report() {
public final String csv() {
StringBuilder sb = new StringBuilder();
String header =
"#RunID, ClientID, MsgCount, MsgBytes, MsgsPerSec, BytesPerSec, DurationSecs";
"#RunID, ClientID, Test Msgs, MsgsPerSec, BytesPerSec, Total Msgs, Total Bytes, DurationSecs";

sb.append(String.format("%s stats: %s\n", name, this));
sb.append(header); sb.append("\n");
Expand All @@ -145,8 +145,10 @@ String csvLines(SampleGroup grp, String prefix) {
StringBuilder sb = new StringBuilder();
int j = 0;
for (Sample stat : grp.getSamples()) {
String line = String.format("%s,%s%d,%d,%d,%d,%f,%f", runId, prefix, j++, stat.msgCnt,
stat.msgBytes, stat.rate(), stat.throughput(),
String line = String.format("%s,%s%d,%d,%d,%.2f,%d,%d,%.4f", runId,
prefix, j++,
stat.getJobMsgCnt(), stat.rate(), stat.throughput(),
stat.msgCnt, stat.msgBytes,
(double) stat.duration() / 1000000000.0);
sb.append(line); sb.append("\n");
}
Expand Down

0 comments on commit 74bf92e

Please sign in to comment.