diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/bench/Main.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/bench/Main.java b/src/main/java/bench/Main.java index 0ce0f3c..a12c22b 100644 --- a/src/main/java/bench/Main.java +++ b/src/main/java/bench/Main.java @@ -42,6 +42,9 @@ public class Main implements Callable<Integer> { @Option(names = {"--flush"}, description = "Call LogManager.shutdown() to flush at end of each test (default: false)") private boolean flush = false; + @Option(names = {"--drop-caches"}, description = "Drop OS file caches before each test (requires sudo, default: false)") + private boolean dropCaches = false; + public static void main(String[] args) { // Must set context selector before ANY Log4j initialization // We'll set it dynamically per-config in BenchRunner instead @@ -88,8 +91,10 @@ public class Main implements Callable<Integer> { for (String configName : config.getConfigs()) { System.out.printf("Running: %s ...%n", configName); try { - // Drop caches before each test - dropCaches(); + // Drop caches before each test if requested + if (dropCaches) { + dropCaches(); + } // Build command with appropriate system properties List<String> cmd = new ArrayList<>(); |
