File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,22 @@ import (
10
10
)
11
11
12
12
const (
13
- TRANSFER_CONNECTIONS = 10
13
+ TRANSFER_CONNECTIONS = 4
14
14
INIT_AMOUNT = 10000
15
- N_ITERATIONS = 10000
16
- N_ACCOUNTS = 100000
15
+ N_ITERATIONS = 100000
16
+ N_ACCOUNTS = 16
17
17
)
18
18
19
19
20
20
var cfg1 = pgx.ConnConfig {
21
- Host : "astro9 " ,
22
- Port : 15432 ,
21
+ Host : "localhost " ,
22
+ Port : 5432 ,
23
23
Database : "postgres" ,
24
24
}
25
25
26
26
var cfg2 = pgx.ConnConfig {
27
- Host : "astro9 " ,
28
- Port : 15433 ,
27
+ Host : "localhost " ,
28
+ Port : 5433 ,
29
29
Database : "postgres" ,
30
30
}
31
31
@@ -109,8 +109,8 @@ func transfer(id int, wg *sync.WaitGroup) {
109
109
110
110
gtid := strconv .Itoa (id ) + "." + strconv .Itoa (i )
111
111
amount := 2 * rand .Intn (2 ) - 1
112
- account1 := 2 * id + 1
113
- account2 := 2 * id + 2
112
+ account1 := rand . Intn ( N_ACCOUNTS )
113
+ account2 := rand . Intn ( N_ACCOUNTS )
114
114
115
115
exec (conn1 , "begin transaction" )
116
116
exec (conn2 , "begin transaction" )
You can’t perform that action at this time.
0 commit comments