@@ -165,6 +165,7 @@ bool use_quiet; /* quiet logging onto stderr */
165
165
int agg_interval ; /* log aggregates instead of individual
166
166
* transactions */
167
167
int progress = 0 ; /* thread progress report every this seconds */
168
+ bool progress_timestamp = false; /* progress report with Unix time */
168
169
int progress_nclients = 0 ; /* number of clients for progress
169
170
* report */
170
171
int progress_nthreads = 0 ; /* number of threads for progress
@@ -388,6 +389,7 @@ usage(void)
388
389
" -v, --vacuum-all vacuum all four standard tables before tests\n"
389
390
" --aggregate-interval=NUM aggregate data over NUM seconds\n"
390
391
" --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"
391
393
"\nCommon options:\n"
392
394
" -d, --debug print debugging output\n"
393
395
" -h, --host=HOSTNAME database server host or socket directory\n"
@@ -2773,6 +2775,7 @@ main(int argc, char **argv)
2773
2775
{"aggregate-interval" , required_argument , NULL , 5 },
2774
2776
{"rate" , required_argument , NULL , 'R' },
2775
2777
{"latency-limit" , required_argument , NULL , 'L' },
2778
+ {"progress-timestamp" , no_argument , NULL , 6 },
2776
2779
{NULL , 0 , NULL , 0 }
2777
2780
};
2778
2781
@@ -3109,6 +3112,10 @@ main(int argc, char **argv)
3109
3112
}
3110
3113
#endif
3111
3114
break ;
3115
+ case 6 :
3116
+ progress_timestamp = true;
3117
+ benchmarking_option_set = true;
3118
+ break ;
3112
3119
default :
3113
3120
fprintf (stderr , _ ("Try \"%s --help\" for more information.\n" ), progname );
3114
3121
exit (1 );
@@ -3747,6 +3754,7 @@ threadRun(void *arg)
3747
3754
sqlat ,
3748
3755
lag ,
3749
3756
stdev ;
3757
+ char tbuf [64 ];
3750
3758
3751
3759
/*
3752
3760
* Add up the statistics of all threads.
@@ -3779,10 +3787,16 @@ threadRun(void *arg)
3779
3787
stdev = 0.001 * sqrt (sqlat - 1000000.0 * latency * latency );
3780
3788
lag = 0.001 * (lags - last_lags ) / (count - last_count );
3781
3789
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
+
3782
3796
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
+
3786
3800
if (throttle_delay )
3787
3801
{
3788
3802
fprintf (stderr , ", lag %.3f ms" , lag );
0 commit comments