@@ -85,6 +85,11 @@ public static void main(String[] args) throws Exception {
85
85
intervalMonitor = Integer .parseInt (argsLine .getOptionValue ("im" ));
86
86
}
87
87
88
+ Boolean useVirtualThreads = false ;
89
+ if (argsLine .hasOption ("vt" )) {
90
+ useVirtualThreads = Boolean .parseBoolean (argsLine .getOptionValue ("vt" ));
91
+ }
92
+
88
93
// -------------------------------------------------------------------
89
94
// GET PLUGIN LIST
90
95
// -------------------------------------------------------------------
@@ -518,7 +523,7 @@ public static void main(String[] args) throws Exception {
518
523
if (isBooleanOptionSet (argsLine , "execute" )) {
519
524
// Bombs away!
520
525
try {
521
- Results r = runWorkload (benchList , intervalMonitor );
526
+ Results r = runWorkload (benchList , intervalMonitor , useVirtualThreads );
522
527
writeOutputs (r , activeTXTypes , argsLine , xmlConfig );
523
528
writeHistograms (r );
524
529
@@ -567,6 +572,7 @@ private static Options buildOptions(XMLConfiguration pluginConfig) {
567
572
"Base directory for the result files, default is current directory" );
568
573
options .addOption (null , "dialects-export" , true , "Export benchmark SQL to a dialects file" );
569
574
options .addOption ("jh" , "json-histograms" , true , "Export histograms to JSON file" );
575
+ options .addOption ("vt" , "virtual-threads" , true , "Use virtual threads instead of real threads" );
570
576
return options ;
571
577
}
572
578
@@ -733,7 +739,8 @@ private static void runLoader(BenchmarkModule bench)
733
739
bench .loadDatabase ();
734
740
}
735
741
736
- private static Results runWorkload (List <BenchmarkModule > benchList , int intervalMonitor )
742
+ private static Results runWorkload (
743
+ List <BenchmarkModule > benchList , int intervalMonitor , Boolean useVirtualThreads )
737
744
throws IOException {
738
745
List <Worker <?>> workers = new ArrayList <>();
739
746
List <WorkloadConfiguration > workConfs = new ArrayList <>();
@@ -748,7 +755,8 @@ private static Results runWorkload(List<BenchmarkModule> benchList, int interval
748
755
bench .getBenchmarkName ().toUpperCase (), num_phases , (num_phases > 1 ? "s" : "" )));
749
756
workConfs .add (bench .getWorkloadConfiguration ());
750
757
}
751
- Results r = ThreadBench .runRateLimitedBenchmark (workers , workConfs , intervalMonitor );
758
+ Results r =
759
+ ThreadBench .runRateLimitedBenchmark (workers , workConfs , intervalMonitor , useVirtualThreads );
752
760
LOG .info (SINGLE_LINE );
753
761
LOG .info ("Rate limited reqs/s: {}" , r );
754
762
return r ;
0 commit comments