2
2
3
3
This project is a secure, lightweight SaaS-like database latency testing tool with a Mobile GUI, along with REST API.
4
4
5
-
6
-
7
5
https://github.com/user-attachments/assets/74497e35-a85b-4051-bee0-99a3c1ed67d0
8
6
9
-
10
-
11
7
Built with ❤️ using FastAPI.
12
8
13
-
14
9
## 1. Clone Repository ##
15
10
``` bash
16
11
git clone https://github.com/oracle-quickstart/db-endpoint-latency-testing-ammeter.git && cd db-endpoint-latency-testing-ammeter/
17
12
```
18
-
19
13
## 2. Set ` APP_ADMIN_PASS ` environment variable ##
20
14
``` bash
21
15
export APP_ADMIN_PASS=' abcd1234'
22
16
```
23
-
24
17
## 3. Quick Build with One-Command ##
25
18
``` bash
26
19
bash build.sh
27
20
```
28
-
29
21
## 4. Launch the Web App; Only required when you restart the App ##
30
22
``` bash
31
23
uvicorn app.main:app --host 0.0.0.0 --port 8000
@@ -55,9 +47,6 @@ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
55
47
-d period=10 \
56
48
| jq .
57
49
```
58
-
59
-
60
-
61
50
## 7. Custom User SQL : API Usage via Curl/CLI MySQL Example ##
62
51
63
52
To test with a custom SQL query from the command line, simply add a -d custom_sql="YOUR SQL HERE" parameter to your curl command, like this:
@@ -76,7 +65,6 @@ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
76
65
-d custom_sql=" select count(*) from WIN2019SNAREDC_SNARE_IA;" \
77
66
| jq .
78
67
```
79
-
80
68
- If ` custom_sql ` is included (and not empty), that query is used for measuring latency (instead of ` SELECT 1 ` ).
81
69
82
70
- All other parameters stay the same as before.
@@ -126,12 +114,10 @@ Stop the Delta App
126
114
``` bash
127
115
bash stop.sh
128
116
```
129
-
130
117
Start the Delta App
131
118
``` bash
132
119
bash start.sh
133
120
```
134
-
135
121
## Windows Build File (Beta: Not tested)
136
122
137
123
Yes, you must first download (clone or extract) the GitHub repo to your Windows machine.
@@ -145,22 +131,20 @@ __Instructions:__
145
131
- Open Command Prompt or PowerShell.
146
132
- Run:
147
133
148
- ``` javascript
134
+ ``` javascript
149
135
git clone https: // github.com/oracle-quickstart/db-endpoint-latency-testing-ammeter.git
150
136
cd db- endpoint- latency- testing- ammeter
151
137
```
152
-
153
138
- Or download the zip from the GitHub releases or code page, and extract all files to a folder.
154
139
155
140
2. __Run the Build Script__
156
141
157
142
- In Command Prompt (NOT PowerShell), navigate to the project folder.
158
143
- Run:
159
144
160
- ` ` ` javascript
145
+ ` ` ` javascript
161
146
build_windows.bat
162
147
` ` `
163
-
164
148
- This script will:
165
149
166
150
- Create a virtual environment
@@ -175,6 +159,134 @@ __Requirements on Windows:__
175
159
176
160
You do not need to manually install anything except Python and openssl; the script handles the rest.
177
161
162
+ -- -
163
+
164
+ # Testing Remote Databases Over SSH Tunnel and API
165
+
166
+ This section shows how to set up SSH tunnels to connect to remote databases from your local machine, and how to test each supported database type using the REST API or the GUI .
167
+
168
+ ## SSH Tunnel Setup
169
+
170
+ ### Oracle Autonomous Database (ADB ) SSH Tunnel
171
+ ` ` ` bash
172
+ ssh -fNT -v -L 1522:10.180.2.238:1521 opc@168.138.10.135 -i "/Users/shadab/Downloads/OracleContent/Keys/mydemo_vcn.priv"
173
+ ` ` `
174
+ ### Local Oracle DB SSH Tunnel
175
+ ` ` ` bash
176
+ ssh -fNT -v -L 1521:10.180.2.158:1521 opc@168.138.10.135 -i "/Users/shadab/Downloads/OracleContent/Keys/mydemo_vcn.priv"
177
+ ` ` `
178
+ ### PostgreSQL SSH Tunnel
179
+ ` ` ` bash
180
+ ssh -fNT -v -L 5432:10.180.2.205:5432 opc@168.138.10.135 -i "/Users/shadab/Downloads/OracleContent/Keys/mydemo_vcn.priv"
181
+ ` ` `
182
+ ### MySQL SSH Tunnel
183
+ ` ` ` bash
184
+ ssh -fNT -v -L 3306:10.180.2.30:3306 opc@168.138.10.135 -i "/Users/shadab/Downloads/OracleContent/Keys/mydemo_vcn.priv"
185
+ ` ` `
186
+ ## API Usage Examples
187
+
188
+ ### 1. PostgreSQL
189
+
190
+ #### CLI
191
+ ` ` ` bash
192
+ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
193
+ -k \
194
+ -d dbtype=postgresql \
195
+ -d host=localhost \
196
+ -d port=5432 \
197
+ -d username=ggadmin \
198
+ -d password="RAbbithole1234##" \
199
+ -d database=dvdrental \
200
+ -d interval=1 \
201
+ -d period=5 \
202
+ | jq .
203
+ ` ` `
204
+ #### GUI
205
+ < img width= " 458" alt= " Screenshot 2025-07-05 at 11 02 13 PM" src= " https://github.com/user-attachments/assets/528fe2d5-6f2f-45bd-bcf6-7ee1309fc51e" / >
206
+
207
+
208
+ -- -
209
+
210
+ ### 2. MySQL
211
+
212
+ #### CLI
213
+ ` ` ` bash
214
+ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
215
+ -k \
216
+ -d dbtype=mysql \
217
+ -d host=localhost \
218
+ -d port=3306 \
219
+ -d username=admin \
220
+ -d password="RAbbithole1234##" \
221
+ -d database=dvdrental \
222
+ -d interval=1 \
223
+ -d period=5 \
224
+ | jq .
225
+ ` ` `
226
+ #### GUI
227
+ < img width= " 458" alt= " Screenshot 2025-07-05 at 11 02 20 PM" src= " https://github.com/user-attachments/assets/d8895bcf-617c-447a-86d5-9ec65dba7476" / >
228
+
229
+
230
+ -- -
231
+
232
+ ### 3. Oracle (Standard/ On- Premise)
233
+
234
+ #### CLI
235
+ ` ` ` bash
236
+ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
237
+ -k \
238
+ -d dbtype=oracle \
239
+ -d host=localhost \
240
+ -d port=1521 \
241
+ -d username=mpos \
242
+ -d password="abcdABCD1234##" \
243
+ -d database=T1DB04 \
244
+ -d interval=1 \
245
+ -d period=5 \
246
+ | jq .
247
+ ` ` `
248
+ #### GUI
249
+ < img width= " 376" alt= " Screenshot 2025-07-05 at 11 42 13 PM" src= " https://github.com/user-attachments/assets/880f58f8-3e09-40f1-9282-43341c7227a1" / >
250
+
251
+
252
+ -- -
253
+
254
+ ### 4. Oracle ADB (TLS / TCPS Connection)
255
+
256
+ #### CLI
257
+ ` ` ` bash
258
+ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
259
+ -k \
260
+ -d dbtype=oracle \
261
+ -d host="(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=localhost))(connect_data=(service_name=g9b8049aad9c64c_spotlightdemo_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))" \
262
+ -d username=dvdrental \
263
+ -d password="RAbbithole1234##" \
264
+ -d interval=1 \
265
+ -d period=5 \
266
+ | jq .
267
+ ` ` `
268
+ #### GUI
269
+ < img width= " 376" alt= " Screenshot 2025-07-05 at 11 33 13 PM" src= " https://github.com/user-attachments/assets/351897b5-2c8b-482b-8310-c6a0401d58d6" / >
270
+
271
+ -- -
272
+
273
+ ### 5. URL (HTTP / HTTPS Endpoint)
274
+
275
+ #### CLI
276
+ ` ` ` bash
277
+ curl -u admin:abcd1234 -X POST https://localhost:8000/api/test-latency \
278
+ -k \
279
+ -d dbtype=url \
280
+ -d url="https://google.com" \
281
+ -d interval=1 \
282
+ -d period=5 \
283
+ | jq .
284
+ ` ` `
285
+ #### GUI
286
+ < img width= " 458" alt= " Screenshot 2025-07-05 at 11 03 00 PM" src= " https://github.com/user-attachments/assets/d97ee854-b7ff-4ee6-af5f-7c1fe127a281" / >
287
+
288
+
289
+ -- -
178
290
179
291
## Contributing
180
292
0 commit comments