From b9bbc70fc6b3e577b5d3ed065939fd8ba2eeb767 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 9 Jan 2026 23:57:11 +0200 Subject: Auto-detect CPU count for default thread count --- src/main/java/bench/Main.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/bench/Main.java') diff --git a/src/main/java/bench/Main.java b/src/main/java/bench/Main.java index a12c22b..565ae13 100644 --- a/src/main/java/bench/Main.java +++ b/src/main/java/bench/Main.java @@ -15,8 +15,8 @@ import java.util.concurrent.Callable; description = "Benchmark Log4j2 logging throughput with various configurations") public class Main implements Callable { - @Option(names = {"-t", "--threads"}, description = "Number of concurrent threads (default: 10)") - private int threads = 10; + @Option(names = {"-t", "--threads"}, description = "Number of concurrent threads (default: available CPUs)") + private int threads = Runtime.getRuntime().availableProcessors(); @Option(names = {"-m", "--mode"}, description = "Test mode: duration or events (default: duration)") private String mode = "duration"; -- cgit v1.2.3