Skip to content

Commit 0e8efed

Browse files
committed
Fix reporting of skipped transactions in pgbench.
Broken by commit 1bc90f7. Fabien Coelho.
1 parent 522400a commit 0e8efed

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/bin/pgbench/pgbench.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,8 +3447,8 @@ main(int argc, char **argv)
34473447

34483448
/* thread level stats */
34493449
throttle_lag += thread->throttle_lag;
3450-
throttle_latency_skipped = threads->throttle_latency_skipped;
3451-
latency_late = thread->latency_late;
3450+
throttle_latency_skipped += threads->throttle_latency_skipped;
3451+
latency_late += thread->latency_late;
34523452
if (throttle_lag_max > thread->throttle_lag_max)
34533453
throttle_lag_max = thread->throttle_lag_max;
34543454
INSTR_TIME_ADD(conn_total_time, thread->conn_time);
@@ -3759,15 +3759,17 @@ threadRun(void *arg)
37593759
}
37603760

37613761
for (i = 0; i < progress_nthreads; i++)
3762+
{
3763+
skipped += thread[i].throttle_latency_skipped;
37623764
lags += thread[i].throttle_lag;
3765+
}
37633766

37643767
total_run = (now - thread_start) / 1000000.0;
37653768
tps = 1000000.0 * (count - last_count) / run;
37663769
latency = 0.001 * (lats - last_lats) / (count - last_count);
37673770
sqlat = 1.0 * (sqlats - last_sqlats) / (count - last_count);
37683771
stdev = 0.001 * sqrt(sqlat - 1000000.0 * latency * latency);
37693772
lag = 0.001 * (lags - last_lags) / (count - last_count);
3770-
skipped = thread->throttle_latency_skipped - last_skipped;
37713773

37723774
fprintf(stderr,
37733775
"progress: %.1f s, %.1f tps, "
@@ -3777,7 +3779,8 @@ threadRun(void *arg)
37773779
{
37783780
fprintf(stderr, ", lag %.3f ms", lag);
37793781
if (latency_limit)
3780-
fprintf(stderr, ", " INT64_FORMAT " skipped", skipped);
3782+
fprintf(stderr, ", " INT64_FORMAT " skipped",
3783+
skipped - last_skipped);
37813784
}
37823785
fprintf(stderr, "\n");
37833786

@@ -3786,7 +3789,7 @@ threadRun(void *arg)
37863789
last_sqlats = sqlats;
37873790
last_lags = lags;
37883791
last_report = now;
3789-
last_skipped = thread->throttle_latency_skipped;
3792+
last_skipped = skipped;
37903793

37913794
/*
37923795
* Ensure that the next report is in the future, in case

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy