You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user_manual/quick_starts/en-US/chapter_03_test_oceanbase_database/06_jmeter_test.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,13 +55,13 @@ Run the `sh jmeter` command in the `apache-jmeter-xxx/bin/` directory to go to t
55
55
56
56
In the left-side navigation pane, click **Oceanbase Test Plan** and choose **Add** > **Threads(Users)** > **Thread Group** to create a thread group. You can configure a variety of parameters when you use JMeter for testing. For more information about the parameters, see [Elements of a Test Plan](https://jmeter.apache.org/usermanual/test_plan.html) in JMeter Documentation.
57
57
58
-

58
+

59
59
60
60
### Add a JDBC connection
61
61
62
62
Click **Thread Group** and choose **Add** > **Config Element** > **JDBC Connection Configuration** to create a JDBC configuration file.
63
63
64
-

64
+

65
65
66
66
The attributes shown in the preceding figure are common parameters of a connection pool. For more information, see the experience in configuring Java connection pools shared on the Internet.
Click **Transaction Controller** and choose **Add** > **Pre Processors** > **User Parameters** to add variables as needed. This test involves three variables: `credit_id` (account A), `debit_id` (account B), and `trans_amount` (transferred amount). The account parameters and amounts are set to random numbers within the actual ranges of test data.
Click **Transaction Controller** and choose **Add** > **Sampler** > **JDBC Request** to create a JDBC request. Set **Query Type** to `AutoCommit(false)` to enable explicit transactions.
95
95
96
-

96
+

97
97
98
98
* Create a JDBC request to deduct the transferred amount from the balance of account A
99
99
100
100
Click **Transaction Controller** and choose **Add** > **Sampler** > **JDBC Request**, to create a JDBC request named `JDBC update credit account`. Then, add an SQL request to deduct the transferred amount from the balance of account A.
101
101
102
-

102
+

103
103
104
104
* Add Post logic to obtain the return value of the JDBC request that deducts the transferred amount from the balance of account A
105
105
106
106
Click **JDBC update credit account** and choose **Add** > **Post Processors** > **Regular Expression Extractor** to add Post logic to obtain the return value of the JDBC request that deducts the transferred amount from the balance of account A.
107
107
108
-

108
+

109
109
110
110
* Create a JDBC request to increase the balance of account B
111
111
112
112
Click **Transaction Controller** and choose **Add** > **Sampler** > **JDBC Request** to create a JDBC request named `JDBC update debit account`. Then, add an SQL request to increase the balance of account B.
113
113
114
-

114
+

115
115
116
116
* Add Post logic to obtain the return value of the JDBC request that increases the balance of account B
117
117
118
118
Click **JDBC update debit account** and choose **Add** > **Post Processors** > **Regular Expression Extractor** to add Post logic to obtain the return result of the JDBC request that increases the balance of account B.
119
119
120
-

120
+

121
121
122
122
### Judgment logic - process succeeded
123
123
@@ -127,13 +127,13 @@ If the updates for both accounts are successful, the transaction is committed.
127
127
128
128
Click **Transaction Controller** and choose **Add** > **Logic Controller** > **If Controller** to add an IF controller named `If success`. Then, add judgment conditions.
129
129
130
-

130
+

131
131
132
132
* Add a commit action upon update success
133
133
134
134
Click **If success** and choose **Add** > **Sampler** > **JDBC Request** to create a JDBC request. Set **Query Type** to `Commit`.
135
135
136
-

136
+

137
137
138
138
### Judgment logic - process failed
139
139
@@ -143,20 +143,20 @@ If the update for either account fails, the transaction is rolled back.
143
143
144
144
Click **Transaction Controller** and choose **Add** > **Logic Controller** > **If Controller** to create an IF controller named `If fail`. Then, add judgment conditions.
145
145
146
-

146
+

147
147
148
148
* Add a commit action upon update failure
149
149
150
150
Click **If fail** and choose **Add** > **Sampler** > **JDBC Request** to create a JDBC request. Set **Query Type** to `Rollback`.
151
151
152
-

152
+

153
153
154
154
### View the results
155
155
156
156
Click **Thread-Group** and choose **Add** > **Listener** > **View Results Tree** to create a result tree file to view the test results.
157
157
158
-

158
+

159
159
160
160
Click **Thread Group** and choose **Add** > **Listener** > **Aggregate Report** to create an aggregated report that aggregates the results.
161
161
162
-

0 commit comments