Skip to content

Commit ed850db

Browse files
committed
Add progres indicator at the prepare stage of transfers test.
1 parent 1c90d78 commit ed850db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contrib/pg_dtm/tests/transfers.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,17 @@ func prepare_db() {
7070
exec(conn1, "begin transaction isolation level " + ISOLATION_LEVEL)
7171
exec(conn2, "begin transaction isolation level " + ISOLATION_LEVEL)
7272

73+
start := time.Now()
7374
for i := 0; i < N_ACCOUNTS; i++ {
7475
exec(conn1, "insert into t values($1, $2)", i, INIT_AMOUNT)
7576
exec(conn2, "insert into t values($1, $2)", i, INIT_AMOUNT)
77+
if time.Since(start).Seconds() > 1 {
78+
fmt.Printf(
79+
"inserted %0.2f%%: %d of %d records\n",
80+
float32(i + 1) * 100.0 / float32(N_ACCOUNTS), i + 1, N_ACCOUNTS,
81+
)
82+
start = time.Now()
83+
}
7684
}
7785

7886
commit(conn1, conn2)

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