add trace logging
This commit is contained in:
@@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.lucares.pdb.api.Entry;
|
||||
import org.lucares.pdb.api.GroupResult;
|
||||
import org.lucares.pdb.api.Result;
|
||||
import org.lucares.pdb.api.Tags;
|
||||
import org.lucares.pdb.plot.api.CustomAggregator;
|
||||
@@ -96,9 +97,9 @@ public class Plotter {
|
||||
final AtomicInteger idCounter = new AtomicInteger(0);
|
||||
result.getGroups().stream().parallel().forEach(groupResult -> {
|
||||
try{
|
||||
final Stream<Entry> entries = groupResult.asStream();
|
||||
|
||||
|
||||
final CsvSummary csvSummary = toCsv(entries, tmpDir, dateFrom, dateTo, plotSettings);
|
||||
final CsvSummary csvSummary = toCsv(groupResult, tmpDir, dateFrom, dateTo, plotSettings);
|
||||
|
||||
final int id = idCounter.getAndIncrement();
|
||||
final String title = title(groupResult.getGroupedBy(), csvSummary.getValues());
|
||||
@@ -232,11 +233,12 @@ public class Plotter {
|
||||
|
||||
}
|
||||
|
||||
private static CsvSummary toCsv(final Stream<Entry> entries, final Path tmpDir, final OffsetDateTime dateFrom,
|
||||
private static CsvSummary toCsv(final GroupResult groupResult, final Path tmpDir, final OffsetDateTime dateFrom,
|
||||
final OffsetDateTime dateTo, PlotSettings plotSettings) throws IOException {
|
||||
|
||||
final File dataFile = File.createTempFile("data", ".dat", tmpDir.toFile());
|
||||
final long start = System.nanoTime();
|
||||
final Stream<Entry> entries = groupResult.asStream();
|
||||
int count = 0;
|
||||
final long fromEpochMilli = dateFrom.toInstant().toEpochMilli();
|
||||
final long toEpochMilli = dateTo.toInstant().toEpochMilli();
|
||||
@@ -285,7 +287,7 @@ public class Plotter {
|
||||
}
|
||||
}
|
||||
|
||||
METRICS_LOGGER.debug("wrote {} values to csv in: {}ms (ignored {} values) use millis: {}", count, (System.nanoTime() - start) / 1_000_000.0, ignoredValues, Boolean.toString(useMillis));
|
||||
METRICS_LOGGER.debug("wrote {} values to csv in: {}ms (ignored {} values) use millis: {}, grouping={}, file={}", count, (System.nanoTime() - start) / 1_000_000.0, ignoredValues, Boolean.toString(useMillis), groupResult.getGroupedBy(),dataFile);
|
||||
return new CsvSummary(dataFile, count, maxValue, aggregator.getAggregatedData());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user