public ProgressLoggers addRatePercentCounter(String name, long total, LongSupplier getValue,
    Function<Number, String> formatter, boolean color) {
    // if there's no total, we can't show progress so fall back to rate logger instead
    if (total == 0) {
      return addRateCounter(name, getValue, color);
    }
    AtomicLong last = new AtomicLong(getValue.getAsLong());
    AtomicLong lastTime = new AtomicLong(System.nanoTime());
    loggers.add(new ProgressLogger(name, () -> {
      long now = System.nanoTime();
      long valueNow = getValue.getAsLong();
      double timeDiff = (now - lastTime.get()) * 1d / (1d * TimeUnit.SECONDS.toNanos(1));
      long valueDiff = valueNow - last.get();
      if (valueDiff < 0) {
        valueDiff = valueNow;
      }
      last.set(valueNow);
      lastTime.set(now);
      String result =
        "[ " + formatter.apply(valueNow) + " " + padLeft(format.percent(1f * valueNow / total), 4) + " " +
          formatter.apply(valueDiff / timeDiff) + "/s ]";
      return (color && valueDiff > 0) ? green(result) : result;
    }));
    return this;
  }
Adds "name: [ numCompleted pctComplete% rate/s ]" to the logger where {@code total} is the total number of items to
process.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProgressLoggers.java