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

Commit9a65fb3

Browse files
committed
Allow total number of transactions in pgbench to exceed INT_MAX.
Change the total-transactions counters from int32 to int64 to accommodatecases where we do more than 2^31 transactions during a run. This patchdoes not change the INT_MAX limit on explicit "-t" parameters, but itdoes allow the product of the -t and -c parameters to exceed INT_MAX, orallow a -T limit that is large enough that more than 2^31 transactionscan be completed. While pgbench did not actually fail in such cases,it did print an incorrect total-transactions count, and some of thederived numbers such as TPS would have been wrong as well.Tomas Vondra
1 parent9fa9353 commit9a65fb3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎contrib/pgbench/pgbench.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ typedef struct
239239
typedefstruct
240240
{
241241
instr_timeconn_time;
242-
intxacts;
242+
int64xacts;
243243
int64latencies;
244244
int64sqlats;
245245
int64throttle_lag;
@@ -2180,7 +2180,7 @@ process_builtin(char *tb)
21802180

21812181
/* print out results */
21822182
staticvoid
2183-
printResults(intttype,intnormal_xacts,intnclients,
2183+
printResults(intttype,int64normal_xacts,intnclients,
21842184
TState*threads,intnthreads,
21852185
instr_timetotal_time,instr_timeconn_total_time,
21862186
int64total_latencies,int64total_sqlats,
@@ -2213,13 +2213,13 @@ printResults(int ttype, int normal_xacts, int nclients,
22132213
if (duration <=0)
22142214
{
22152215
printf("number of transactions per client: %d\n",nxacts);
2216-
printf("number of transactions actually processed:%d/%d\n",
2217-
normal_xacts,nxacts*nclients);
2216+
printf("number of transactions actually processed:"INT64_FORMAT"/"INT64_FORMAT"\n",
2217+
normal_xacts,(int64)nxacts*nclients);
22182218
}
22192219
else
22202220
{
22212221
printf("duration: %d s\n",duration);
2222-
printf("number of transactions actually processed:%d\n",
2222+
printf("number of transactions actually processed:"INT64_FORMAT"\n",
22232223
normal_xacts);
22242224
}
22252225

@@ -2359,7 +2359,7 @@ main(int argc, char **argv)
23592359
instr_timestart_time;/* start up time */
23602360
instr_timetotal_time;
23612361
instr_timeconn_total_time;
2362-
inttotal_xacts=0;
2362+
int64total_xacts=0;
23632363
int64total_latencies=0;
23642364
int64total_sqlats=0;
23652365
int64throttle_lag=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp