From 2d78a70883300e762bd9f9d2e1ed70cb4e70d9d9 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sun, 2 Apr 2017 11:15:24 +0200 Subject: [PATCH] duration for inserts was wrong The bug was, that we computed the difference between millis and nanos. Also log duration for flushes. --- .../main/java/org/lucares/performance/db/PerformanceDb.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java b/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java index 08eb1fb..43f41f0 100644 --- a/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java +++ b/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java @@ -86,7 +86,7 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils { count++; if (count % blocksize == 0) { - final long end = System.nanoTime(); + final long end = System.currentTimeMillis(); final long duration = end - start; LOGGER.debug("inserting the last " + blocksize + " took " + duration + " ms; total entries: " + count / 1_000_000.0 + " million"); @@ -95,7 +95,9 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils { } if (count % blocksize == 0) { + final long startFlush = System.currentTimeMillis(); tagsToFile.flush(); + LOGGER.debug("flushed all files: " + (System.currentTimeMillis() - startFlush) + "ms"); } } catch (final InvalidValueException e) {