From a7e21471cdc51ef7eaf4837c01b98e39316b9ab1 Mon Sep 17 00:00:00 2001 From: "zhengyu.gu" Date: Tue, 8 Jul 2025 14:56:24 -0400 Subject: [PATCH 1/2] Relax benchmark commandline restriction --- .../jmh/java/com/datadoghq/profiler/stresstest/Main.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java b/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java index d71346a8..5809990e 100644 --- a/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java +++ b/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java @@ -17,12 +17,9 @@ public class Main { public static void main(String... args) throws Exception { String filter = "*"; - if (args.length == 1) { + if (args.length >= 1) { filter = args[0]; - } else if (args.length > 1) { - System.err.println("Usage: java -jar ddprof-stresstest.jar [scenario filter]"); - System.exit(1); - } + } CommandLineOptions commandLineOptions = new CommandLineOptions(args); Mode mode = Mode.AverageTime; Options options = new OptionsBuilder() From f97ff035da1b5fbc68db96ae600601852a4a9cb2 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 10 Jul 2025 09:04:18 -0400 Subject: [PATCH 2/2] v2 --- ddprof-stresstest/build.gradle | 2 +- .../jmh/java/com/datadoghq/profiler/stresstest/Main.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ddprof-stresstest/build.gradle b/ddprof-stresstest/build.gradle index 2934e4ac..9f073711 100644 --- a/ddprof-stresstest/build.gradle +++ b/ddprof-stresstest/build.gradle @@ -39,7 +39,7 @@ task runStressTests(type: Exec) { } group = 'Execution' description = 'Run JMH stresstests' - commandLine "${javaHome}/bin/java", '-jar', 'build/libs/stresstests.jar', 'counters.*' + commandLine "${javaHome}/bin/java", '-jar', 'build/libs/stresstests.jar', '-prof', 'com.datadoghq.profiler.stresstest.WhiteboxProfiler', 'counters.*' } tasks.withType(JavaCompile).configureEach { diff --git a/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java b/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java index 5809990e..c8d5994f 100644 --- a/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java +++ b/ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/Main.java @@ -16,16 +16,10 @@ public class Main { public static final String SCENARIOS_PACKAGE = "com.datadoghq.profiler.stresstest.scenarios."; public static void main(String... args) throws Exception { - String filter = "*"; - if (args.length >= 1) { - filter = args[0]; - } CommandLineOptions commandLineOptions = new CommandLineOptions(args); Mode mode = Mode.AverageTime; Options options = new OptionsBuilder() .parent(new CommandLineOptions(args)) - .include(SCENARIOS_PACKAGE + filter) - .addProfiler(WhiteboxProfiler.class) .forks(commandLineOptions.getForkCount().orElse(1)) .warmupIterations(commandLineOptions.getWarmupIterations().orElse(0)) .measurementIterations(commandLineOptions.getMeasurementIterations().orElse(1))