From 6a95811f1e48419bf242cd2902bafc5de818f8a9 Mon Sep 17 00:00:00 2001 From: Alan Paxton Date: Tue, 7 Jan 2025 10:09:42 +0000 Subject: [PATCH] Fix format --- .../org/rocksdb/OpenFSyncPerformanceTest.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/java/src/test/java/org/rocksdb/OpenFSyncPerformanceTest.java b/java/src/test/java/org/rocksdb/OpenFSyncPerformanceTest.java index dbffcbb0786..554a443a27a 100644 --- a/java/src/test/java/org/rocksdb/OpenFSyncPerformanceTest.java +++ b/java/src/test/java/org/rocksdb/OpenFSyncPerformanceTest.java @@ -15,29 +15,29 @@ * `MACOS_IGNORE_FULLFSYNC` can be used to build fast test-only versions of RocksDB for efficient CI usage */ public class OpenFSyncPerformanceTest { - - @Test - public void testOpen() throws RocksDBException { - int count = 100; - ArrayList deltas = new ArrayList<>(count); - long sum = 0; - for (int i = 0; i < count; i++) { - long start = System.currentTimeMillis(); - try(RocksDB db = RocksDB.open("test-open-" + i)) { - long delta = System.currentTimeMillis() - start; - //System.out.println("RocksDB.open() cost:" + (delta)); - sum += delta; - deltas.add(delta); - } finally { - RocksDB.destroyDB("test-open-" +i, new Options()); - } - } - long mean = sum / count; - long variance = 0; - for (long d : deltas) { - variance += (d - mean) * (d - mean); - } - double sd = Math.sqrt((double) (variance/count)); - System.out.println("RocksDB.open() mean cost:" + (sum/count) + ", SD: " + sd + ", count: " + count); + @Test + public void testOpen() throws RocksDBException { + int count = 100; + ArrayList deltas = new ArrayList<>(count); + long sum = 0; + for (int i = 0; i < count; i++) { + long start = System.currentTimeMillis(); + try (RocksDB db = RocksDB.open("test-open-" + i)) { + long delta = System.currentTimeMillis() - start; + // System.out.println("RocksDB.open() cost:" + (delta)); + sum += delta; + deltas.add(delta); + } finally { + RocksDB.destroyDB("test-open-" + i, new Options()); + } + } + long mean = sum / count; + long variance = 0; + for (long d : deltas) { + variance += (d - mean) * (d - mean); } + double sd = Math.sqrt((double) (variance / count)); + System.out.println( + "RocksDB.open() mean cost:" + (sum / count) + ", SD: " + sd + ", count: " + count); + } }