@@ -87,6 +87,11 @@ public static void main(String[] args) throws Exception {
8787 intervalMonitor = Integer .parseInt (argsLine .getOptionValue ("im" ));
8888 }
8989
90+ Boolean useVirtualThreads = false ;
91+ if (argsLine .hasOption ("vt" )) {
92+ useVirtualThreads = Boolean .parseBoolean (argsLine .getOptionValue ("vt" ));
93+ }
94+
9095 // -------------------------------------------------------------------
9196 // GET PLUGIN LIST
9297 // -------------------------------------------------------------------
@@ -459,7 +464,7 @@ public static void main(String[] args) throws Exception {
459464 if (isBooleanOptionSet (argsLine , "execute" )) {
460465 // Bombs away!
461466 try {
462- Results r = runWorkload (benchList , intervalMonitor );
467+ Results r = runWorkload (benchList , intervalMonitor , useVirtualThreads );
463468 writeOutputs (r , activeTXTypes , argsLine , xmlConfig );
464469 writeHistograms (r );
465470
@@ -493,6 +498,7 @@ private static Options buildOptions(XMLConfiguration pluginConfig) {
493498 options .addOption ("d" , "directory" , true , "Base directory for the result files, default is current directory" );
494499 options .addOption (null , "dialects-export" , true , "Export benchmark SQL to a dialects file" );
495500 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" );
496502 return options ;
497503 }
498504
@@ -631,7 +637,7 @@ private static void runLoader(BenchmarkModule bench) throws SQLException, Interr
631637 bench .loadDatabase ();
632638 }
633639
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 {
635641 List <Worker <?>> workers = new ArrayList <>();
636642 List <WorkloadConfiguration > workConfs = new ArrayList <>();
637643 for (BenchmarkModule bench : benchList ) {
@@ -643,7 +649,7 @@ private static Results runWorkload(List<BenchmarkModule> benchList, int interval
643649 workConfs .add (bench .getWorkloadConfiguration ());
644650
645651 }
646- Results r = ThreadBench .runRateLimitedBenchmark (workers , workConfs , intervalMonitor );
652+ Results r = ThreadBench .runRateLimitedBenchmark (workers , workConfs , intervalMonitor , useVirtualThreads );
647653 LOG .info (SINGLE_LINE );
648654 LOG .info ("Rate limited reqs/s: {}" , r );
649655 return r ;
0 commit comments