Commit 0e8efed5 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix reporting of skipped transactions in pgbench.

Broken by commit 1bc90f7a.

Fabien Coelho.
parent 522400a5
...@@ -3447,8 +3447,8 @@ main(int argc, char **argv) ...@@ -3447,8 +3447,8 @@ main(int argc, char **argv)
/* thread level stats */ /* thread level stats */
throttle_lag += thread->throttle_lag; throttle_lag += thread->throttle_lag;
throttle_latency_skipped = threads->throttle_latency_skipped; throttle_latency_skipped += threads->throttle_latency_skipped;
latency_late = thread->latency_late; latency_late += thread->latency_late;
if (throttle_lag_max > thread->throttle_lag_max) if (throttle_lag_max > thread->throttle_lag_max)
throttle_lag_max = thread->throttle_lag_max; throttle_lag_max = thread->throttle_lag_max;
INSTR_TIME_ADD(conn_total_time, thread->conn_time); INSTR_TIME_ADD(conn_total_time, thread->conn_time);
...@@ -3759,7 +3759,10 @@ threadRun(void *arg) ...@@ -3759,7 +3759,10 @@ threadRun(void *arg)
} }
for (i = 0; i < progress_nthreads; i++) for (i = 0; i < progress_nthreads; i++)
{
skipped += thread[i].throttle_latency_skipped;
lags += thread[i].throttle_lag; lags += thread[i].throttle_lag;
}
total_run = (now - thread_start) / 1000000.0; total_run = (now - thread_start) / 1000000.0;
tps = 1000000.0 * (count - last_count) / run; tps = 1000000.0 * (count - last_count) / run;
...@@ -3767,7 +3770,6 @@ threadRun(void *arg) ...@@ -3767,7 +3770,6 @@ threadRun(void *arg)
sqlat = 1.0 * (sqlats - last_sqlats) / (count - last_count); sqlat = 1.0 * (sqlats - last_sqlats) / (count - last_count);
stdev = 0.001 * sqrt(sqlat - 1000000.0 * latency * latency); stdev = 0.001 * sqrt(sqlat - 1000000.0 * latency * latency);
lag = 0.001 * (lags - last_lags) / (count - last_count); lag = 0.001 * (lags - last_lags) / (count - last_count);
skipped = thread->throttle_latency_skipped - last_skipped;
fprintf(stderr, fprintf(stderr,
"progress: %.1f s, %.1f tps, " "progress: %.1f s, %.1f tps, "
...@@ -3777,7 +3779,8 @@ threadRun(void *arg) ...@@ -3777,7 +3779,8 @@ threadRun(void *arg)
{ {
fprintf(stderr, ", lag %.3f ms", lag); fprintf(stderr, ", lag %.3f ms", lag);
if (latency_limit) if (latency_limit)
fprintf(stderr, ", " INT64_FORMAT " skipped", skipped); fprintf(stderr, ", " INT64_FORMAT " skipped",
skipped - last_skipped);
} }
fprintf(stderr, "\n"); fprintf(stderr, "\n");
...@@ -3786,7 +3789,7 @@ threadRun(void *arg) ...@@ -3786,7 +3789,7 @@ threadRun(void *arg)
last_sqlats = sqlats; last_sqlats = sqlats;
last_lags = lags; last_lags = lags;
last_report = now; last_report = now;
last_skipped = thread->throttle_latency_skipped; last_skipped = skipped;
/* /*
* Ensure that the next report is in the future, in case * Ensure that the next report is in the future, in case
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment