]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
progress bar -- don't print num jobs, time elapsed shown in seconds
authorPaul Cruz <paulcruz74@fb.com>
Tue, 25 Jul 2017 21:26:55 +0000 (14:26 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Tue, 25 Jul 2017 21:26:55 +0000 (14:26 -0700)
contrib/adaptive-compression/adapt.c

index d1fe753c94f145f04bf0e53ccd9b3a048abac9cf..098f6fc902b05039d329a8622f28562a18ff4fb5 100644 (file)
@@ -600,7 +600,7 @@ static void* compressionThread(void* arg)
     return arg;
 }
 
-static void displayProgress(unsigned jobDoneID, unsigned cLevel, unsigned last)
+static void displayProgress(unsigned cLevel, unsigned last)
 {
     if (!g_useProgressBar) return;
     UTIL_time_t currTime;
@@ -608,7 +608,7 @@ static void displayProgress(unsigned jobDoneID, unsigned cLevel, unsigned last)
     double const timeElapsed = (double)(UTIL_getSpanTimeMicro(g_ticksPerSecond, g_startTime, currTime) / 1000.0);
     double const sizeMB = (double)g_streamedSize / (1 << 20);
     double const avgCompRate = sizeMB * 1000 / timeElapsed;
-    fprintf(stderr, "\r| %4u jobs completed | Current Compresion Level: %2u | Time Elapsed: %5.0f ms | Data Size: %7.1f MB | Avg Compression Rate: %6.2f MB/s |", jobDoneID, cLevel, timeElapsed, sizeMB, avgCompRate);
+    fprintf(stderr, "\r| Comp. Level: %2u | Time Elapsed: %5.0f ms | Data Size: %7.1f MB | Avg Comp. Rate: %6.2f MB/s |", cLevel, timeElapsed/1000.0, sizeMB, avgCompRate);
     if (last) {
         fprintf(stderr, "\n");
     }
@@ -681,7 +681,7 @@ static void* outputThread(void* arg)
             }
         }
         DEBUG(3, "finished job write %u\n", currJob);
-        displayProgress(currJob, ctx->compressionLevel, job->lastJobPlusOne == currJob + 1);
+        displayProgress(ctx->compressionLevel, job->lastJobPlusOne == currJob + 1);
         DEBUG(3, "locking job write mutex\n");
         pthread_mutex_lock(&ctx->jobWrite_mutex.pMutex);
         ctx->jobWriteID++;