diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2015-08-17 10:11:47 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2015-08-17 10:13:51 +0300 |
commit | 0e8efed59e7f98f237e90fba20364165f7cc9ba9 (patch) | |
tree | 210402b6998c99f02126058c75915ba5f6d64f6a | |
parent | 522400a5198f63823406202e18fdaf3621619d98 (diff) | |
download | postgresql-0e8efed59e7f98f237e90fba20364165f7cc9ba9.tar.gz postgresql-0e8efed59e7f98f237e90fba20364165f7cc9ba9.zip |
Fix reporting of skipped transactions in pgbench.
Broken by commit 1bc90f7a.
Fabien Coelho.
-rw-r--r-- | src/bin/pgbench/pgbench.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 6f5bd994a09..2e55c906b62 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -3447,8 +3447,8 @@ main(int argc, char **argv) /* thread level stats */ throttle_lag += thread->throttle_lag; - throttle_latency_skipped = threads->throttle_latency_skipped; - latency_late = thread->latency_late; + throttle_latency_skipped += threads->throttle_latency_skipped; + latency_late += thread->latency_late; if (throttle_lag_max > thread->throttle_lag_max) throttle_lag_max = thread->throttle_lag_max; INSTR_TIME_ADD(conn_total_time, thread->conn_time); @@ -3759,7 +3759,10 @@ threadRun(void *arg) } for (i = 0; i < progress_nthreads; i++) + { + skipped += thread[i].throttle_latency_skipped; lags += thread[i].throttle_lag; + } total_run = (now - thread_start) / 1000000.0; tps = 1000000.0 * (count - last_count) / run; @@ -3767,7 +3770,6 @@ threadRun(void *arg) sqlat = 1.0 * (sqlats - last_sqlats) / (count - last_count); stdev = 0.001 * sqrt(sqlat - 1000000.0 * latency * latency); lag = 0.001 * (lags - last_lags) / (count - last_count); - skipped = thread->throttle_latency_skipped - last_skipped; fprintf(stderr, "progress: %.1f s, %.1f tps, " @@ -3777,7 +3779,8 @@ threadRun(void *arg) { fprintf(stderr, ", lag %.3f ms", lag); if (latency_limit) - fprintf(stderr, ", " INT64_FORMAT " skipped", skipped); + fprintf(stderr, ", " INT64_FORMAT " skipped", + skipped - last_skipped); } fprintf(stderr, "\n"); @@ -3786,7 +3789,7 @@ threadRun(void *arg) last_sqlats = sqlats; last_lags = lags; last_report = now; - last_skipped = thread->throttle_latency_skipped; + last_skipped = skipped; /* * Ensure that the next report is in the future, in case |