public ProgressLoggers addProcessStats() {
    addOptionalDeltaLogger("cpus", ProcessInfo::getProcessCpuTime, num -> blue(format.decimal(num)));
    addDeltaLogger("gc", ProcessInfo::getGcTime, num -> {
      String formatted = format.percent(num);
      return num > 0.6 ? red(formatted) : num > 0.3 ? yellow(formatted) : formatted;
    });
    loggers.add(new ProgressLogger("heap",
      () -> format.storage(ProcessInfo.getOnHeapUsedMemoryBytes(), false) + "/" +
        format.storage(ProcessInfo.getMaxMemoryBytes(), false) +
        OptionalLong.of(ProcessInfo.getDirectUsedMemoryBytes()).stream()
          .filter(usage -> usage > 0)
          .mapToObj(mem -> " direct: " + format.storage(mem))
          .findFirst()
          .orElse("") +
        ProcessInfo.getMemoryUsageAfterLastGC().stream()
          .mapToObj(value -> " postGC: " + blue(format.storage(value, false)))
          .findFirst()
          .orElse("")
    ));
    return this;
  }
Adds the average number of CPUs and % time in GC since last log along with memory usage, total memory, and memory
used after last GC to the output.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProgressLoggers.java