@@ -176,6 +176,8 @@ intnthreads = 1;/* number of threads */
176
176
bool is_connect ;/* establish connection for each transaction */
177
177
bool is_latencies ;/* report per-command latencies */
178
178
int main_pid ;/* main process id used in log filename */
179
+ bool report_failures = false;/* whether to report serialization and
180
+ * deadlock failures per command */
179
181
180
182
char * pghost = "" ;
181
183
char * pgport = "" ;
@@ -477,6 +479,7 @@ usage(void)
477
479
" -v, --vacuum-all vacuum all four standard tables before tests\n"
478
480
" --aggregate-interval=NUM aggregate data over NUM seconds\n"
479
481
" --progress-timestamp use Unix epoch timestamps for progress\n"
482
+ " --report-failures report serialization and deadlock failures per command\n"
480
483
" --sampling-rate=NUM fraction of transactions to log (e.g., 0.01 for 1%%)\n"
481
484
"\nCommon options:\n"
482
485
" -d, --debug print debugging output\n"
@@ -3479,7 +3482,6 @@ printResults(TState *threads, StatsData *total, instr_time total_time,
3479
3482
if (per_script_stats || latency_limit || is_latencies )
3480
3483
{
3481
3484
int i ;
3482
- Command * * commands ;
3483
3485
3484
3486
for (i = 0 ;i < num_scripts ;i ++ )
3485
3487
{
@@ -3517,24 +3519,40 @@ printResults(TState *threads, StatsData *total, instr_time total_time,
3517
3519
3518
3520
/*
3519
3521
* Report per-command serialization / deadlock failures and
3520
- * latencies (if needed). */
3521
- if (is_latencies )
3522
- printf (" - statement serialization, deadlock failures and latencies in milliseconds:\n" );
3523
- else
3524
- printf (" - statement serialization and deadlock failures:\n" );
3525
-
3526
- for (commands = sql_script [i ].commands ;
3527
- * commands != NULL ;
3528
- commands ++ )
3522
+ * latencies */
3523
+ if (report_failures || is_latencies )
3529
3524
{
3530
- printf (" %25" INT64_MODIFIER "d %25" INT64_MODIFIER "d" ,
3531
- (* commands )-> serialization_failures ,
3532
- (* commands )-> deadlock_failures );
3533
- if (is_latencies )
3534
- printf (" %11.3f" ,
3535
- 1000.0 * (* commands )-> stats .sum /
3536
- (* commands )-> stats .count );
3537
- printf (" %s\n" , (* commands )-> line );
3525
+ Command * * commands ;
3526
+
3527
+ if (report_failures && is_latencies )
3528
+ printf (" - statement serialization, deadlock failures and latencies in milliseconds:\n" );
3529
+ else if (report_failures )
3530
+ printf (" - statement serialization and deadlock failures:\n" );
3531
+ else
3532
+ printf (" - statement latencies in milliseconds:\n" );
3533
+
3534
+ for (commands = sql_script [i ].commands ;
3535
+ * commands != NULL ;
3536
+ commands ++ )
3537
+ {
3538
+ if (report_failures && is_latencies )
3539
+ printf (" %25" INT64_MODIFIER "d %25" INT64_MODIFIER "d %11.3f %s\n" ,
3540
+ (* commands )-> serialization_failures ,
3541
+ (* commands )-> deadlock_failures ,
3542
+ 1000.0 * (* commands )-> stats .sum /
3543
+ (* commands )-> stats .count ,
3544
+ (* commands )-> line );
3545
+ else if (report_failures )
3546
+ printf (" %25" INT64_MODIFIER "d %25" INT64_MODIFIER "d %s\n" ,
3547
+ (* commands )-> serialization_failures ,
3548
+ (* commands )-> deadlock_failures ,
3549
+ (* commands )-> line );
3550
+ else
3551
+ printf (" %11.3f %s\n" ,
3552
+ 1000.0 * (* commands )-> stats .sum /
3553
+ (* commands )-> stats .count ,
3554
+ (* commands )-> line );
3555
+ }
3538
3556
}
3539
3557
}
3540
3558
}
@@ -3584,6 +3602,7 @@ main(int argc, char **argv)
3584
3602
#ifdef WITH_RSOCKET
3585
3603
{"with-rsocket" ,no_argument ,NULL ,7 },
3586
3604
#endif
3605
+ {"report-failures" ,no_argument ,NULL ,8 },
3587
3606
{NULL ,0 ,NULL ,0 }
3588
3607
};
3589
3608
@@ -3893,7 +3912,6 @@ main(int argc, char **argv)
3893
3912
case 'I' :
3894
3913
{
3895
3914
benchmarking_option_set = true;
3896
- per_script_stats = true;
3897
3915
3898
3916
for (default_isolation_level = 0 ;
3899
3917
default_isolation_level < NUM_DEFAULT_ISOLATION_LEVEL ;
@@ -3956,6 +3974,11 @@ main(int argc, char **argv)
3956
3974
isRsocket = true;
3957
3975
break ;
3958
3976
#endif
3977
+ case 8 :
3978
+ benchmarking_option_set = true;
3979
+ per_script_stats = true;
3980
+ report_failures = true;
3981
+ break ;
3959
3982
default :
3960
3983
fprintf (stderr ,_ ("Try \"%s --help\" for more information.\n" ),progname );
3961
3984
exit (1 );