sometimes plots are missing
The csv generation is running in parallel, but the list that collects the results was not synchronized.
This commit is contained in:
@@ -14,6 +14,7 @@ import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Formatter;
|
||||
import java.util.Iterator;
|
||||
@@ -82,7 +83,7 @@ public class Plotter {
|
||||
final Path tmpDir = tmpBaseDir.resolve(tmpSubDir);
|
||||
try {
|
||||
Files.createDirectories(tmpDir);
|
||||
final List<DataSeries> dataSeries = new ArrayList<>();
|
||||
final List<DataSeries> dataSeries = Collections.synchronizedList(new ArrayList<>());
|
||||
|
||||
final String query = plotSettings.getQuery();
|
||||
final List<String> groupBy = plotSettings.getGroupBy();
|
||||
@@ -97,8 +98,6 @@ public class Plotter {
|
||||
final AtomicInteger idCounter = new AtomicInteger(0);
|
||||
result.getGroups().stream().parallel().forEach(groupResult -> {
|
||||
try{
|
||||
|
||||
|
||||
final CsvSummary csvSummary = toCsv(groupResult, tmpDir, dateFrom, dateTo, plotSettings);
|
||||
|
||||
final int id = idCounter.getAndIncrement();
|
||||
|
||||
Reference in New Issue
Block a user