Skip to content

Commit fc8a185

Browse files
Update README.md
1 parent d3c286c commit fc8a185

File tree

1 file changed

+130
-18
lines changed

1 file changed

+130
-18
lines changed

README.md

Lines changed: 130 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,22 @@
22

33
This project is a secure, lightweight SaaS-like database latency testing tool with a Mobile GUI, along with REST API.
44

5-
6-
75
https://github.com/user-attachments/assets/74497e35-a85b-4051-bee0-99a3c1ed67d0
86

9-
10-
117
Built with ❤️ using FastAPI.
128

13-
149
## 1. Clone Repository ##
1510
```bash
1611
git clone https://github.com/oracle-quickstart/db-endpoint-latency-testing-ammeter.git && cd db-endpoint-latency-testing-ammeter/
1712
```
18-
1913
## 2. Set `APP_ADMIN_PASS` environment variable ##
2014
```bash
2115
export APP_ADMIN_PASS='abcd1234'
2216
```
23-
2417
## 3. Quick Build with One-Command ##
2518
```bash
2619
bash build.sh
2720
```
28-
2921
## 4. Launch the Web App; Only required when you restart the App ##
3022
```bash
3123
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 \
5547
-d period=10 \
5648
| jq .
5749
```
58-
59-
60-
6150
## 7. Custom User SQL : API Usage via Curl/CLI MySQL Example ##
6251

6352
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 \
7665
-d custom_sql="select count(*) from WIN2019SNAREDC_SNARE_IA;" \
7766
| jq .
7867
```
79-
8068
- If `custom_sql` is included (and not empty), that query is used for measuring latency (instead of `SELECT 1`).
8169

8270
- All other parameters stay the same as before.
@@ -126,12 +114,10 @@ Stop the Delta App
126114
```bash
127115
bash stop.sh
128116
```
129-
130117
Start the Delta App
131118
```bash
132119
bash start.sh
133120
```
134-
135121
## Windows Build File (Beta: Not tested)
136122

137123
Yes, you must first download (clone or extract) the GitHub repo to your Windows machine.
@@ -145,22 +131,20 @@ __Instructions:__
145131
- Open Command Prompt or PowerShell.
146132
- Run:
147133

148-
```javascript
134+
```javascript
149135
git clone https://github.com/oracle-quickstart/db-endpoint-latency-testing-ammeter.git
150136
cd db-endpoint-latency-testing-ammeter
151137
```
152-
153138
- Or download the zip from the GitHub releases or code page, and extract all files to a folder.
154139

155140
2. __Run the Build Script__
156141

157142
- In Command Prompt (NOT PowerShell), navigate to the project folder.
158143
- Run:
159144

160-
```javascript
145+
```javascript
161146
build_windows.bat
162147
```
163-
164148
- This script will:
165149

166150
- Create a virtual environment
@@ -175,6 +159,134 @@ __Requirements on Windows:__
175159

176160
You do not need to manually install anything except Python and openssl; the script handles the rest.
177161

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+
---
178290

179291
## Contributing
180292

0 commit comments

Comments
 (0)