@@ -87,6 +87,11 @@ public static void main(String[] args) throws Exception {
87
87
intervalMonitor = Integer .parseInt (argsLine .getOptionValue ("im" ));
88
88
}
89
89
90
+ Boolean useVirtualThreads = false ;
91
+ if (argsLine .hasOption ("vt" )) {
92
+ useVirtualThreads = Boolean .parseBoolean (argsLine .getOptionValue ("vt" ));
93
+ }
94
+
90
95
// -------------------------------------------------------------------
91
96
// GET PLUGIN LIST
92
97
// -------------------------------------------------------------------
@@ -459,7 +464,7 @@ public static void main(String[] args) throws Exception {
459
464
if (isBooleanOptionSet (argsLine , "execute" )) {
460
465
// Bombs away!
461
466
try {
462
- Results r = runWorkload (benchList , intervalMonitor );
467
+ Results r = runWorkload (benchList , intervalMonitor , useVirtualThreads );
463
468
writeOutputs (r , activeTXTypes , argsLine , xmlConfig );
464
469
writeHistograms (r );
465
470
@@ -493,6 +498,7 @@ private static Options buildOptions(XMLConfiguration pluginConfig) {
493
498
options .addOption ("d" , "directory" , true , "Base directory for the result files, default is current directory" );
494
499
options .addOption (null , "dialects-export" , true , "Export benchmark SQL to a dialects file" );
495
500
options .addOption ("jh" , "json-histograms" , true , "Export histograms to JSON file" );
501
+ options .addOption ("vt" , "virtual-threads" , true , "Use virtual threads instead of real threads" );
496
502
return options ;
497
503
}
498
504
@@ -631,7 +637,7 @@ private static void runLoader(BenchmarkModule bench) throws SQLException, Interr
631
637
bench .loadDatabase ();
632
638
}
633
639
634
- private static Results runWorkload (List <BenchmarkModule > benchList , int intervalMonitor ) throws IOException {
640
+ private static Results runWorkload (List <BenchmarkModule > benchList , int intervalMonitor , Boolean useVirtualThreads ) throws IOException {
635
641
List <Worker <?>> workers = new ArrayList <>();
636
642
List <WorkloadConfiguration > workConfs = new ArrayList <>();
637
643
for (BenchmarkModule bench : benchList ) {
@@ -643,7 +649,7 @@ private static Results runWorkload(List<BenchmarkModule> benchList, int interval
643
649
workConfs .add (bench .getWorkloadConfiguration ());
644
650
645
651
}
646
- Results r = ThreadBench .runRateLimitedBenchmark (workers , workConfs , intervalMonitor );
652
+ Results r = ThreadBench .runRateLimitedBenchmark (workers , workConfs , intervalMonitor , useVirtualThreads );
647
653
LOG .info (SINGLE_LINE );
648
654
LOG .info ("Rate limited reqs/s: {}" , r );
649
655
return r ;
0 commit comments