code: public void prepareStatus() {
          globalLineCounter = new AtomicLong(0);
          time = new AtomicLong(System.currentTimeMillis());
          startTime = System.currentTimeMillis();
          lastCount = 0;
  
          // Status thread regularly reports on what is happening
          Thread statusThread = new Thread() {
              public void run() {
                  while (true) {
                      try {
                          Thread.sleep(1000);
                      } catch (InterruptedException e) {
                          System.out.println("Status thread interrupted");
                      }
  
                      long thisTime = System.currentTimeMillis();
                      long currentCount = globalLineCounter.get();
  
                      if (thisTime - time.get() > 1000) {
                          long oldTime = time.get();
                          time.set(thisTime);
                          double avgRate = 1000.0 * currentCount / (thisTime - startTime);
                          double instRate = 1000.0 * (currentCount - lastCount) / (thisTime - oldTime);
                          lastCount = currentCount;
                          System.out.println(currentCount + " AvgRage:" + ((int) avgRate) + " lines/sec  instRate:"
                                  + ((int) instRate) + " lines/sec  Unassigned Work: "
                                  + remainingBlocks.get() + " blocks");
                      }
                  }
              }
          };
          statusThread.start();
      }
docs: Establishes a thread that on one second intervals reports the number of remaining WorkBlocks enqueued and the
  total number of lines written and reported by consumers