Skip to content

Commit 852ea50

Browse files
committed
Add track failure option parameter in rest server
1 parent af16ac7 commit 852ea50

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/Loader.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public static void main(String[] args) throws IOException {
214214
Option retry = new Option("retry", true, "Retry failures n times");
215215
options.addOption(retry);
216216

217+
Option trackFailures = new Option("trackFailures", true, "Track failures");
218+
options.addOption(trackFailures);
219+
217220
HelpFormatter formatter = new HelpFormatter();
218221
CommandLineParser parser = new DefaultParser();
219222
CommandLine cmd;
@@ -307,12 +310,12 @@ public static void main(String[] args) throws IOException {
307310
for (int i = 0; i < ws.workers; i++) {
308311
try {
309312
String th_name = "Loader" + i;
310-
boolean trackFailures = false;
313+
boolean _trackFailures = Boolean.parseBoolean(cmd.getOptionValue("trackFailures", "false"));
311314
if (Integer.parseInt(cmd.getOptionValue("retry", "0")) > 0)
312-
trackFailures = true;
315+
_trackFailures = true;
313316
tm.submit(new WorkLoadGenerate(th_name, dg, client, esClient, cmd.getOptionValue("durability", "NONE"),
314317
Integer.parseInt(cmd.getOptionValue("maxTTL", "0")),
315-
cmd.getOptionValue("maxTTLUnit", "seconds"), trackFailures,
318+
cmd.getOptionValue("maxTTLUnit", "seconds"), _trackFailures,
316319
Integer.parseInt(cmd.getOptionValue("retry", "0")), null));
317320
TimeUnit.MILLISECONDS.sleep(500);
318321
} catch (Exception e) {

0 commit comments

Comments
 (0)