public void recordTile(TileCoord coord, int archivedBytes, List<TileSizeStats.LayerStats> layerStats) {
      var tileStat = summary.byTile.get(coord.z());
      var layerStat = summary.byLayer.get(coord.z());
      tileStat.archivedBytes.accept(archivedBytes);
      tileStat.acceptBigTile(coord, archivedBytes, layerStats);
      long weight = tileWeights.getWeight(coord);
      tileStat.totalWeight += weight;
      tileStat.weightedArchivedBytesSum += weight * archivedBytes;

      int sum = 0;
      for (var layer : layerStats) {
        var cell = layerStat.computeIfAbsent(layer.layer(), Updater::newCell);
        cell.bytes.accept(layer.layerBytes());
        cell.acceptBigTile(coord, layer.layerBytes(), layerStats);
        sum += layer.layerBytes();
        cell.weightedBytesSum += weight * layer.layerBytes();
        cell.totalWeight += weight;
      }
      tileStat.weightedBytesSum += weight * sum;
      tileStat.bytes.accept(sum);
    }
Thread local updater that accepts individual statistics for each tile.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/TilesetSummaryStatistics.java