diff options
author | Tom Lane | 2014-05-25 20:33:29 +0000 |
---|---|---|
committer | Tom Lane | 2014-05-25 20:33:29 +0000 |
commit | 9a65fb350717360c505de9df411024d47e55710b (patch) | |
tree | ceb34ba40cfbe9163a685729213b7b32a691f483 /contrib/pgbench/pgbench.c | |
parent | 9fa93530c878a0e23147a65f7d9a62802b22a995 (diff) |
Allow total number of transactions in pgbench to exceed INT_MAX.
Change the total-transactions counters from int32 to int64 to accommodate
cases where we do more than 2^31 transactions during a run. This patch
does not change the INT_MAX limit on explicit "-t" parameters, but it
does allow the product of the -t and -c parameters to exceed INT_MAX, or
allow a -T limit that is large enough that more than 2^31 transactions
can be completed. While pgbench did not actually fail in such cases,
it did print an incorrect total-transactions count, and some of the
derived numbers such as TPS would have been wrong as well.
Tomas Vondra
Diffstat (limited to 'contrib/pgbench/pgbench.c')
-rw-r--r-- | contrib/pgbench/pgbench.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 6cc06d79e0f..4aa8a5031a0 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -239,7 +239,7 @@ typedef struct typedef struct { instr_time conn_time; - int xacts; + int64 xacts; int64 latencies; int64 sqlats; int64 throttle_lag; @@ -2180,7 +2180,7 @@ process_builtin(char *tb) /* print out results */ static void -printResults(int ttype, int normal_xacts, int nclients, +printResults(int ttype, int64 normal_xacts, int nclients, TState *threads, int nthreads, instr_time total_time, instr_time conn_total_time, int64 total_latencies, int64 total_sqlats, @@ -2213,13 +2213,13 @@ printResults(int ttype, int normal_xacts, int nclients, if (duration <= 0) { printf("number of transactions per client: %d\n", nxacts); - printf("number of transactions actually processed: %d/%d\n", - normal_xacts, nxacts * nclients); + printf("number of transactions actually processed: " INT64_FORMAT "/" INT64_FORMAT "\n", + normal_xacts, (int64) nxacts * nclients); } else { printf("duration: %d s\n", duration); - printf("number of transactions actually processed: %d\n", + printf("number of transactions actually processed: " INT64_FORMAT "\n", normal_xacts); } @@ -2359,7 +2359,7 @@ main(int argc, char **argv) instr_time start_time; /* start up time */ instr_time total_time; instr_time conn_total_time; - int total_xacts = 0; + int64 total_xacts = 0; int64 total_latencies = 0; int64 total_sqlats = 0; int64 throttle_lag = 0; |