Skip to content

Commit

Permalink
feat(s3stream/wal/benchmark): make iops configurable (#940)
Browse files Browse the repository at this point in the history
Signed-off-by: Ning Yu <[email protected]>
  • Loading branch information
Chillax-0v0 authored Feb 21, 2024
1 parent 5c8a476 commit f7a57c6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public WriteBench(Config config) throws IOException {
if (config.depth != null) {
builder.ioThreadNums(config.depth);
}
if (config.iops != null) {
builder.writeRateLimit(config.iops);
}
this.log = builder.build();
this.log.start();
recoverAndReset(this.log);
Expand Down Expand Up @@ -194,6 +197,7 @@ static class Config {
final String path;
final Long capacity;
final Integer depth;
final Integer iops;

// following fields are benchmark configuration
final Integer threads;
Expand All @@ -205,6 +209,7 @@ static class Config {
this.path = ns.getString("path");
this.capacity = ns.getLong("capacity");
this.depth = ns.getInt("depth");
this.iops = ns.getInt("iops");
this.threads = ns.getInt("threads");
this.throughputBytes = ns.getInt("throughput");
this.recordSizeBytes = ns.getInt("recordSize");
Expand All @@ -227,6 +232,9 @@ static ArgumentParser parser() {
parser.addArgument("-d", "--depth")
.type(Integer.class)
.help("IO depth of the WAL");
parser.addArgument("--iops")
.type(Integer.class)
.help("IOPS of the WAL");
parser.addArgument("--threads")
.type(Integer.class)
.setDefault(1)
Expand Down

0 comments on commit f7a57c6

Please sign in to comment.