Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e667fa

Browse files
author
Marina Polyakova
committed
Pgbench Report per-command serialization and deadlock failures option
They are reported only if you use new --report-failures benchmarking option.
1 parentf4358ea commit0e667fa

File tree

1 file changed

+42
-19
lines changed

1 file changed

+42
-19
lines changed

‎src/bin/pgbench/pgbench.c

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ intnthreads = 1;/* number of threads */
176176
boolis_connect;/* establish connection for each transaction */
177177
boolis_latencies;/* report per-command latencies */
178178
intmain_pid;/* main process id used in log filename */
179+
boolreport_failures= false;/* whether to report serialization and
180+
* deadlock failures per command */
179181

180182
char*pghost="";
181183
char*pgport="";
@@ -477,6 +479,7 @@ usage(void)
477479
" -v, --vacuum-all vacuum all four standard tables before tests\n"
478480
" --aggregate-interval=NUM aggregate data over NUM seconds\n"
479481
" --progress-timestamp use Unix epoch timestamps for progress\n"
482+
" --report-failures report serialization and deadlock failures per command\n"
480483
" --sampling-rate=NUM fraction of transactions to log (e.g., 0.01 for 1%%)\n"
481484
"\nCommon options:\n"
482485
" -d, --debug print debugging output\n"
@@ -3479,7 +3482,6 @@ printResults(TState *threads, StatsData *total, instr_time total_time,
34793482
if (per_script_stats||latency_limit||is_latencies)
34803483
{
34813484
inti;
3482-
Command**commands;
34833485

34843486
for (i=0;i<num_scripts;i++)
34853487
{
@@ -3517,24 +3519,40 @@ printResults(TState *threads, StatsData *total, instr_time total_time,
35173519

35183520
/*
35193521
* 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)
35293524
{
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+
elseif (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+
elseif (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+
}
35383556
}
35393557
}
35403558
}
@@ -3584,6 +3602,7 @@ main(int argc, char **argv)
35843602
#ifdefWITH_RSOCKET
35853603
{"with-rsocket",no_argument,NULL,7},
35863604
#endif
3605+
{"report-failures",no_argument,NULL,8},
35873606
{NULL,0,NULL,0}
35883607
};
35893608

@@ -3893,7 +3912,6 @@ main(int argc, char **argv)
38933912
case'I':
38943913
{
38953914
benchmarking_option_set= true;
3896-
per_script_stats= true;
38973915

38983916
for (default_isolation_level=0;
38993917
default_isolation_level<NUM_DEFAULT_ISOLATION_LEVEL;
@@ -3956,6 +3974,11 @@ main(int argc, char **argv)
39563974
isRsocket= true;
39573975
break;
39583976
#endif
3977+
case8:
3978+
benchmarking_option_set= true;
3979+
per_script_stats= true;
3980+
report_failures= true;
3981+
break;
39593982
default:
39603983
fprintf(stderr,_("Try \"%s --help\" for more information.\n"),progname);
39613984
exit(1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp