diff --git a/performanceDb/src/main/java/org/lucares/performance/db/PdbExport.java b/performanceDb/src/main/java/org/lucares/performance/db/PdbExport.java index 5173539..27d431c 100644 --- a/performanceDb/src/main/java/org/lucares/performance/db/PdbExport.java +++ b/performanceDb/src/main/java/org/lucares/performance/db/PdbExport.java @@ -78,7 +78,8 @@ public class PdbExport { long count = 0; long lastEpochMilli = 0; - + long begin = System.currentTimeMillis(); + for (final PdbFile pdbFile : pdbFiles) { if (writer == null || Files.size(exportFile) > GB) { @@ -90,6 +91,8 @@ public class PdbExport { exportFiles.add(exportFile); writer = createWriter(exportFile); LOGGER.info("new export file: {}", exportFile); + + lastEpochMilli = 0; } final Stream timeValueStream = PdbFile.toStream(Arrays.asList(pdbFile), db.getDataStore()); @@ -97,6 +100,7 @@ public class PdbExport { final Tags tags = pdbFile.getTags(); final long tagsId = addNewTagsToDictionary(writer, tags, tagsIdCounter); + final Iterator it = timeValueStream.iterator(); while (it.hasNext()) { final LongList entry = it.next(); @@ -117,8 +121,13 @@ public class PdbExport { writer.write('\n'); count++; - if (count % 100000 == 0) { - LOGGER.info("progress: " + count); + final long chunk = 10_000_000; + if (count % chunk == 0) { + long end = System.currentTimeMillis(); + long duration = end-begin; + long entriesPerSecond = (long)((double)chunk / (duration / 1000.0)); + LOGGER.info("progress: {} - {} entries/s + duration {}" , String.format("%,d",count), String.format("%,d",entriesPerSecond), duration); + begin = System.currentTimeMillis(); } } }