Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1960984

Browse files
committed
Update test scripts
1 parentac3efcb commit1960984

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎contrib/pg_dtm/tests/pg_shard_transfers.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
_"github.com/jgallagher/go-libpq"
77
"database/sql"
88
"strconv"
9+
"math/rand"
910
)
1011

1112
const (
@@ -60,8 +61,8 @@ func transfer(id int, wg *sync.WaitGroup) {
6061

6162
fori:=0;i<N_ITERATIONS;i++ {
6263
exec(conn,"begin")
63-
exec(conn,"update t set v = v + 1 where u="+strconv.Itoa(uids1[id]))
64-
exec(conn,"update t set v = v - 1 where u="+strconv.Itoa(uids2[id]))
64+
exec(conn,"update t set v = v + 1 where u="+strconv.Itoa(uids1[rand.Intn(TRANSFER_CONNECTIONS)]))
65+
exec(conn,"update t set v = v - 1 where u="+strconv.Itoa(uids2[rand.Intn(TRANSFER_CONNECTIONS)]))
6566
// exec(conn, "update t set v = v + 1 where u=1")
6667
// exec(conn, "update t set v = v - 1 where u=2")
6768
exec(conn,"commit")

‎contrib/pg_dtm/tests/transfers.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const (
1212
TRANSFER_CONNECTIONS=8
1313
INIT_AMOUNT=10000
1414
N_ITERATIONS=10000
15-
N_ACCOUNTS=TRANSFER_CONNECTIONS//100000
16-
ISOLATION_LEVEL="repeatable read"
17-
//ISOLATION_LEVEL = "read committed"
15+
N_ACCOUNTS=100000
16+
//ISOLATION_LEVEL = "repeatable read"
17+
ISOLATION_LEVEL="read committed"
1818
)
1919

2020

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp