pgbench: Show better progress when loading tuples
authorPeter Eisentraut
Thu, 6 Sep 2012 03:07:47 +0000 (23:07 -0400)
committerPeter Eisentraut
Thu, 6 Sep 2012 03:07:47 +0000 (23:07 -0400)
Show target number of tuples and percentage in addition to current
number.

contrib/pgbench/pgbench.c

index 00cab73f90957c7427a903cb37ea2dc3be200069..f5ac3b1c6d6fdc911be7445ecd41e00e244591ad 100644 (file)
@@ -1420,7 +1420,9 @@ init(bool is_no_vacuum)
        }
 
        if (j % 100000 == 0)
-           fprintf(stderr, "%d tuples done.\n", j);
+           fprintf(stderr, "%d of %d tuples (%d%%) done.\n",
+                   j, naccounts * scale,
+                   j * 100 / (naccounts * scale));
    }
    if (PQputline(con, "\\.\n"))
    {