@@ -165,6 +165,7 @@ bool use_quiet; /* quiet logging onto stderr */
165165int agg_interval ; /* log aggregates instead of individual
166166 * transactions */
167167int progress = 0 ; /* thread progress report every this seconds */
168+ bool progress_timestamp = false; /* progress report with Unix time */
168169int progress_nclients = 0 ; /* number of clients for progress
169170 * report */
170171int progress_nthreads = 0 ; /* number of threads for progress
@@ -388,6 +389,7 @@ usage(void)
388389 " -v, --vacuum-all vacuum all four standard tables before tests\n"
389390 " --aggregate-interval=NUM aggregate data over NUM seconds\n"
390391 " --sampling-rate=NUM fraction of transactions to log (e.g. 0.01 for 1%%)\n"
392+ " --progress-timestamp use Unix epoch timestamps for progress\n"
391393 "\nCommon options:\n"
392394 " -d, --debug print debugging output\n"
393395 " -h, --host=HOSTNAME database server host or socket directory\n"
@@ -2773,6 +2775,7 @@ main(int argc, char **argv)
27732775 {"aggregate-interval" , required_argument , NULL , 5 },
27742776 {"rate" , required_argument , NULL , 'R' },
27752777 {"latency-limit" , required_argument , NULL , 'L' },
2778+ {"progress-timestamp" , no_argument , NULL , 6 },
27762779 {NULL , 0 , NULL , 0 }
27772780 };
27782781
@@ -3109,6 +3112,10 @@ main(int argc, char **argv)
31093112 }
31103113#endif
31113114 break ;
3115+ case 6 :
3116+ progress_timestamp = true;
3117+ benchmarking_option_set = true;
3118+ break ;
31123119 default :
31133120 fprintf (stderr , _ ("Try \"%s --help\" for more information.\n" ), progname );
31143121 exit (1 );
@@ -3747,6 +3754,7 @@ threadRun(void *arg)
37473754 sqlat ,
37483755 lag ,
37493756 stdev ;
3757+ char tbuf [64 ];
37503758
37513759 /*
37523760 * Add up the statistics of all threads.
@@ -3779,10 +3787,16 @@ threadRun(void *arg)
37793787 stdev = 0.001 * sqrt (sqlat - 1000000.0 * latency * latency );
37803788 lag = 0.001 * (lags - last_lags ) / (count - last_count );
37813789
3790+ if (progress_timestamp )
3791+ sprintf (tbuf , "%.03f s" ,
3792+ INSTR_TIME_GET_MILLISEC (now_time ) / 1000.0 );
3793+ else
3794+ sprintf (tbuf , "%.1f s" , total_run );
3795+
37823796 fprintf (stderr ,
3783- "progress: %.1f s, %.1f tps, "
3784- "lat %.3f ms stddev %.3f" ,
3785- total_run , tps , latency , stdev );
3797+ "progress: %s, %.1f tps, lat %.3f ms stddev %.3f" ,
3798+ tbuf , tps , latency , stdev );
3799+
37863800 if (throttle_delay )
37873801 {
37883802 fprintf (stderr , ", lag %.3f ms" , lag );
0 commit comments