Skip to content

Commit

Permalink
log number of elements
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Feb 23, 2022
1 parent 9f97ecd commit 0357f4b
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.onthegomap.planetiler.stats.Counter;
import com.onthegomap.planetiler.stats.ProgressLoggers;
import com.onthegomap.planetiler.stats.Stats;
import com.onthegomap.planetiler.util.Format;
import com.onthegomap.planetiler.util.MemoryEstimator;
import com.onthegomap.planetiler.worker.WorkerPipeline;
import java.io.Closeable;
Expand Down Expand Up @@ -62,6 +63,7 @@
public class OsmReader implements Closeable, MemoryEstimator.HasEstimate {

private static final Logger LOGGER = LoggerFactory.getLogger(OsmReader.class);
private static final Format FORMAT = Format.defaultInstance();
private static final int ROLE_BITS = 16;
private static final int MAX_ROLES = (1 << ROLE_BITS) - 10;
private static final int ROLE_SHIFT = 64 - ROLE_BITS;
Expand Down Expand Up @@ -149,6 +151,10 @@ public void pass1(PlanetilerConfig config) {
.addThreadPoolStats("parse", pbfParsePrefix + "-pool")
.addPipelineStats(pipeline);
pipeline.awaitAndLog(loggers, config.logInterval());
LOGGER.debug(
"nodes: " + FORMAT.integer(PASS1_NODES.get()) +
" ways: " + FORMAT.integer(PASS1_WAYS.get()) +
" relations: " + FORMAT.integer(PASS1_RELATIONS.get()));
timer.stop();
}

Expand Down Expand Up @@ -314,14 +320,20 @@ public void pass2(FeatureGroup writer, PlanetilerConfig config) {

pipeline.awaitAndLog(logger, config.logInterval());

LOGGER.debug(
"nodes: " + FORMAT.integer(nodesProcessed.get()) +
" ways: " + FORMAT.integer(waysProcessed.get()) +
" relations: " + FORMAT.integer(relsProcessed.get()));

timer.stop();

try {
profile.finish(name,
new FeatureCollector.Factory(config, stats),
createFeatureRenderer(writer, config, writer));
} catch (Exception e) {
LOGGER.error("Error calling profile.finish", e);
}
timer.stop();
}

private FeatureRenderer createFeatureRenderer(FeatureGroup writer, PlanetilerConfig config,
Expand Down

0 comments on commit 0357f4b

Please sign in to comment.