mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +03:00
Fix reporting of skipped transactions in pgbench.
Broken by commit 1bc90f7a
.
Fabien Coelho.
This commit is contained in:
@ -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)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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)
|
|||||||
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)
|
|||||||
{
|
{
|
||||||
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)
|
|||||||
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
|
||||||
|
Reference in New Issue
Block a user