Skip to content

Commit

Permalink
[core] make it possible to use zero operation count again. (brianfran…
Browse files Browse the repository at this point in the history
…kcooper#1384)

Previously, if you defined maxexecutiontime and not defined operationcount
parameter (or set operationcount=0), then you were able to run YCSB for a
given period of time and measure the number of operations you get during
the load test.

Since brianfrankcooper#1323 was merged, it it not possible to use operationcount=0, as
the thread count will be set to 0 in this case and no client thread will
be created. This PR makes it possible to use operationcount=0 again.

fixes brianfrankcooper#1382
(cherry picked from commit 650eee2)
  • Loading branch information
symat authored and Tom Blamer committed Feb 11, 2020
1 parent dde7c88 commit dbcad46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/site/ycsb/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private static List<ClientThread> initDb(String dbname, Properties props, int th
opcount = Long.parseLong(props.getProperty(RECORD_COUNT_PROPERTY, DEFAULT_RECORD_COUNT));
}
}
if (threadcount > opcount){
if (threadcount > opcount && opcount > 0){
threadcount = (int)opcount;
System.out.println("Warning: the threadcount is bigger than recordcount, the threadcount will be recordcount!");
}
Expand Down

0 comments on commit dbcad46

Please sign in to comment.