@@ -173,10 +173,9 @@ boolprogress_timestamp = false; /* progress report with Unix time */
173
173
int nclients = 1 ;/* number of clients */
174
174
int nthreads = 1 ;/* number of threads */
175
175
bool is_connect ;/* establish connection for each transaction */
176
- bool is_latencies ;/* report per-command latencies */
176
+ bool report_per_command = false;/* report per-command latencies and
177
+ * failures */
177
178
int main_pid ;/* main process id used in log filename */
178
- bool report_failures = false;/* whether to report serialization and
179
- * deadlock failures per command */
180
179
181
180
char * pghost = "" ;
182
181
char * pgport = "" ;
@@ -470,15 +469,14 @@ usage(void)
470
469
" protocol for submitting queries (default: simple)\n"
471
470
" -n, --no-vacuum do not run VACUUM before tests\n"
472
471
" -P, --progress=NUM show thread progress report every NUM seconds\n"
473
- " -r, --report-latencies report average latency per command\n"
472
+ " -r, --report-per-command report average latency and failures per command\n"
474
473
" -R, --rate=NUM target rate in transactions per second\n"
475
474
" -s, --scale=NUM report this scale factor in output\n"
476
475
" -t, --transactions=NUM number of transactions each client runs (default: 10)\n"
477
476
" -T, --time=NUM duration of benchmark test in seconds\n"
478
477
" -v, --vacuum-all vacuum all four standard tables before tests\n"
479
478
" --aggregate-interval=NUM aggregate data over NUM seconds\n"
480
479
" --progress-timestamp use Unix epoch timestamps for progress\n"
481
- " --report-failures report serialization and deadlock failures per command\n"
482
480
" --sampling-rate=NUM fraction of transactions to log (e.g., 0.01 for 1%%)\n"
483
481
"\nCommon options:\n"
484
482
" -d, --debug print debugging output\n"
@@ -1977,7 +1975,7 @@ doCustom(TState *thread, CState *st, StatsData *agg)
1977
1975
* accumulate per-command execution times in thread-local data
1978
1976
* structure, if per-command latencies are requested
1979
1977
*/
1980
- if (is_latencies && !serialization_failure && !deadlock_failure )
1978
+ if (report_per_command && !serialization_failure && !deadlock_failure )
1981
1979
{
1982
1980
if (INSTR_TIME_IS_ZERO (now ))
1983
1981
INSTR_TIME_SET_CURRENT (now );
@@ -2134,7 +2132,7 @@ doCustom(TState *thread, CState *st, StatsData *agg)
2134
2132
}
2135
2133
2136
2134
/* Record statement start time if per-command latencies are requested */
2137
- if (is_latencies )
2135
+ if (report_per_command )
2138
2136
INSTR_TIME_SET_CURRENT (st -> stmt_begin );
2139
2137
2140
2138
if (commands [st -> state ]-> type == SQL_COMMAND )
@@ -3490,7 +3488,7 @@ printResults(TState *threads, StatsData *total, instr_time total_time,
3490
3488
printf ("tps = %f (excluding connections establishing)\n" ,tps_exclude );
3491
3489
3492
3490
/* Report per-script/command statistics */
3493
- if (per_script_stats || latency_limit || is_latencies )
3491
+ if (per_script_stats || latency_limit || report_per_command )
3494
3492
{
3495
3493
int i ;
3496
3494
@@ -3529,41 +3527,24 @@ printResults(TState *threads, StatsData *total, instr_time total_time,
3529
3527
printSimpleStats (" - latency" ,& sql_script [i ].stats .latency );
3530
3528
3531
3529
/*
3532
- * Report per-command serialization / deadlock failures and
3533
- * latencies */
3534
- if (report_failures || is_latencies )
3530
+ * Report per-command statistics: latencies, serialization &
3531
+ * deadlock failures.
3532
+ */
3533
+ if (report_per_command )
3535
3534
{
3536
3535
Command * * commands ;
3537
3536
3538
- if (report_failures && is_latencies )
3539
- printf (" - statement serialization, deadlock failures and latencies in milliseconds:\n" );
3540
- else if (report_failures )
3541
- printf (" - statement serialization and deadlock failures:\n" );
3542
- else
3543
- printf (" - statement latencies in milliseconds:\n" );
3537
+ printf (" - statement latencies in milliseconds, serialization & deadlock failures:\n" );
3544
3538
3545
3539
for (commands = sql_script [i ].commands ;
3546
3540
* commands != NULL ;
3547
3541
commands ++ )
3548
- {
3549
- if (report_failures && is_latencies )
3550
- printf (" %25" INT64_MODIFIER "d %25" INT64_MODIFIER "d %11.3f %s\n" ,
3551
- (* commands )-> serialization_failures ,
3552
- (* commands )-> deadlock_failures ,
3553
- 1000.0 * (* commands )-> stats .sum /
3554
- (* commands )-> stats .count ,
3555
- (* commands )-> line );
3556
- else if (report_failures )
3557
- printf (" %25" INT64_MODIFIER "d %25" INT64_MODIFIER "d %s\n" ,
3558
- (* commands )-> serialization_failures ,
3559
- (* commands )-> deadlock_failures ,
3560
- (* commands )-> line );
3561
- else
3562
- printf (" %11.3f %s\n" ,
3563
- 1000.0 * (* commands )-> stats .sum /
3564
- (* commands )-> stats .count ,
3565
- (* commands )-> line );
3566
- }
3542
+ printf (" %11.3f %25" INT64_MODIFIER "d %25" INT64_MODIFIER "d %s\n" ,
3543
+ 1000.0 * (* commands )-> stats .sum /
3544
+ (* commands )-> stats .count ,
3545
+ (* commands )-> serialization_failures ,
3546
+ (* commands )-> deadlock_failures ,
3547
+ (* commands )-> line );
3567
3548
}
3568
3549
}
3569
3550
}
@@ -3593,7 +3574,7 @@ main(int argc, char **argv)
3593
3574
{"progress" ,required_argument ,NULL ,'P' },
3594
3575
{"protocol" ,required_argument ,NULL ,'M' },
3595
3576
{"quiet" ,no_argument ,NULL ,'q' },
3596
- {"report-latencies " ,no_argument ,NULL ,'r' },
3577
+ {"report-per-command " ,no_argument ,NULL ,'r' },
3597
3578
{"rate" ,required_argument ,NULL ,'R' },
3598
3579
{"scale" ,required_argument ,NULL ,'s' },
3599
3580
{"select-only" ,no_argument ,NULL ,'S' },
@@ -3613,7 +3594,6 @@ main(int argc, char **argv)
3613
3594
#ifdef WITH_RSOCKET
3614
3595
{"with-rsocket" ,no_argument ,NULL ,7 },
3615
3596
#endif
3616
- {"report-failures" ,no_argument ,NULL ,8 },
3617
3597
{NULL ,0 ,NULL ,0 }
3618
3598
};
3619
3599
@@ -3756,7 +3736,7 @@ main(int argc, char **argv)
3756
3736
case 'r' :
3757
3737
benchmarking_option_set = true;
3758
3738
per_script_stats = true;
3759
- is_latencies = true;
3739
+ report_per_command = true;
3760
3740
break ;
3761
3741
case 's' :
3762
3742
scale_given = true;
@@ -3985,11 +3965,6 @@ main(int argc, char **argv)
3985
3965
isRsocket = true;
3986
3966
break ;
3987
3967
#endif
3988
- case 8 :
3989
- benchmarking_option_set = true;
3990
- per_script_stats = true;
3991
- report_failures = true;
3992
- break ;
3993
3968
default :
3994
3969
fprintf (stderr ,_ ("Try \"%s --help\" for more information.\n" ),progname );
3995
3970
exit (1 );