public void progress ( ) { count ++ ; if ( count % period == 0 && LOG . isInfoEnabled ( ) ) { final double percent = 100 * ( count / ( double ) totalIterations ) ; final long tock = System . currentTimeMillis ( ) ; final long timeInterval = tock - tick ; final long linesPerSec = ( count - prevCount ) * 1000 / timeInterval ; tick = tock ; prevCount = count ; final int etaSeconds = ( int ) ( ( totalIterations - count ) / linesPerSec ) ; final long hours = SECONDS . toHours ( etaSeconds ) ; final long minutes = SECONDS . toMinutes ( etaSeconds - HOURS . toSeconds ( hours ) ) ; final long seconds = SECONDS . toSeconds ( etaSeconds - MINUTES . toSeconds ( minutes ) ) ; LOG . info ( String . format ( "[%3.0f%%] Completed %d iterations of %d total input. %d iters/s. ETA %02d:%02d:%02d" , percent , count , totalIterations , linesPerSec , hours , minutes , seconds ) ) ; } }
Logs the progress .