Skip to content

Commit b50169c

Browse files
Merge pull request #10 from shadab-mohammad-oracle/patch-4
Update README.md
2 parents 13031ed + bff8d15 commit b50169c

File tree

1 file changed

+51
-108
lines changed

1 file changed

+51
-108
lines changed

README.md

Lines changed: 51 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,106 @@
11
# DB(D) Endpoint(E) Latency(L) Testing(T) Ammeter(A)
22

3-
## DELTA
3+
## DELTA - FastAPI based WebApp to test Database Latency (NEW, 2025)
44

5-
📌 Introducing DELTA (DB Endpoint Latency Testing Ammeter). DELTA is a tool to test real-world latency against a remote database using execution of a query and calculating the network return time. The tool provides functions to test latency of Oracle, MySQL and Postgres databases.
5+
This project is a secure, lightweight SaaS-like database latency testing GUI and API, built with FastAPI.
66

7-
The tool uses the oracledb python package to connect to Oracle databases and execute a single query per request (you can specify multiple requests as well). The tool uses the time module to measure the time it takes to execute the query, fetch the results, and close the connection. It calculates the latency of each request and the average latency of all requests.
7+
![Screenshot 2025-07-03 at 11 25 54 PM](https://github.com/user-attachments/assets/1e26dd2c-9423-46b8-9a76-b05b689e72b6)
88

9+
![Screenshot 2025-07-03 at 11 26 17 PM](https://github.com/user-attachments/assets/235f6251-3198-4cd4-99a7-63490b4f6405)
910

10-
🔧 DELTA is a cloud tool to test real-world latency against a remote database endpoint using execution of a query and calculating the network return time.
11+
![Screenshot 2025-07-03 at 11 26 30 PM](https://github.com/user-attachments/assets/f1b17fb8-f637-4b86-95c9-52dd0b6e2067)
1112

13+
## Databases Supported 🔌 :
1214

13-
🔧 Network tools like ping ,iperf or tcp ping can only give you network based latency which does not always translate well to an application running those queries on a remote database.
14-
15-
16-
🐍 DELTA uses Python client for Oracle, MySQL and PostgreSQL to run a query like “SELECT 1” or "SELECT 1 FROM DUAL". You can then specific the number of executions of the query and DELTA calculates the average network round-trip time for all the executions of the query on the remote database. The script also includes error handling to track failed requests. You can also include your own custom queries.
17-
18-
19-
## Databases Supported 🔌 :
20-
21-
22-
### Oracle DB >= 12.2 📌 :
23-
15+
### Oracle DB >= 12.2 📌 :
2416
- Amazon RDS Oracle
25-
2617
- OCI Autonomous Database
27-
2818
- OCI VMDB
29-
3019
- OCI Exadata Cloud Service
31-
3220
- Oracle Database On-Premise
3321

34-
3522
### Postgres >= 11 📌 :
36-
3723
- Amazon RDS Postgres
38-
3924
- Amazon RDS Aurora Postgres
40-
4125
- Postgres On-premise
4226

43-
4427
### MySQL >= 5.7 📌 :
45-
4628
- Amazon RDS MySQL
47-
4829
- Amazon RDS Aurora MySQL
49-
5030
- OCI MySQL Database Service
51-
5231
- OCI MySQL Heatwave
53-
5432
- MySQL On-Premise
5533

56-
5734
### URL - HTTPS | HTTP 📌 :
58-
5935
- Check Public or Private URLs for latency
6036

6137

62-
# Deploy
63-
64-
## Requirement
65-
38+
### 1. Create a Python Virtual Environment
39+
```bash
40+
python3 -m venv .venv
41+
# Activate on Unix/macOS:
42+
source .venv/bin/activate
43+
# Activate on Windows:
44+
.venv\Scripts\activate
6645
```
67-
Python >= 3.6.8
46+
### 2. Install requirements
47+
```bash
48+
pip install -r requirements.txt
6849
```
69-
70-
## Clone Repo
71-
50+
### 3. Launch the Web App
51+
```bash
52+
uvicorn app.main:app --host 0.0.0.0 --port 8000
7253
```
73-
git clone https://github.com/oracle-quickstart/db-endpoint-latency-testing-ammeter.git
74-
75-
cd db-endpoint-latency-testing-ammeter/
76-
77-
python3 -m venv db-endpoint-latency-testing-ammeter
78-
79-
source db-endpoint-latency-testing-ammeter/bin/activate
54+
### 4. Open your browser at:
8055
```
81-
82-
## Install Python packages
56+
http://localhost:8000
8357
```
84-
## On CentOS or Oracle Linux or Redhat Linux
85-
sudo yum install postgresql postgresql-devel python36-devel
86-
87-
## On Ubuntu
88-
sudo apt install libpq-dev python3.x-dev
58+
- Log in: `admin` / `change_this` (update password in `app/main.py` for production).
59+
- Fill out the form and run latency tests in real time with live chart and table views.
60+
- For any errors (connection, authentication) you'll see detailed front-end feedback.
8961

90-
## Install requirements
91-
pip3 install -r requirements.txt
62+
### 5. API Usage via Curl/CLI Example:
63+
```bash
64+
curl -u admin:change_this -X POST http://localhost:8000/api/test-latency \
65+
-F dbtype=postgresql -F host=localhost -F port=5432 -F username=postgres -F password=yourpassword -F database=postgres -F interval=1 -F period=10
9266
```
67+
- API returns JSON, suitable for automation and CI.
9368

94-
# Calculate Latency for Oracle DB
69+
---
9570

96-
Set the below credentials in the delta.py script
97-
```
98-
oracle_un='your_user'
99-
oracle_pw='your_password'
100-
oracle_cs='your_connection_string'
101-
```
102-
Run
103-
```
104-
python3 delta.py --db oracle --interval 3 --period 5 --csvoutput oracle_latency.csv
105-
```
71+
## Command-Line (delta.py) Usage — Secure, No Stored Credentials
10672

73+
The original `delta.py` script remains available for CLI power users and can test Oracle, PostgreSQL, MySQL, and URLs. **No credentials are stored in this file**; you must supply all values as arguments or interactively via a prompt.
10774

108-
# Calculate Latency for MySQL
75+
Use it like this (replace ALL UPPERCASE placeholders):
10976

110-
Set the below credentials in the delta.py script
111-
```
112-
mysql_un = 'mysql'
113-
mysql_pw = 'your_password'
114-
mysql_host = 'localhost'
115-
mysql_port = '3306'
116-
mysql_db = 'mysql'
117-
```
118-
Run
119-
```
120-
python3 delta.py --db mysql --interval 3 --period 5 --csvoutput mysql_latency.csv
121-
```
122-
123-
# Calculate Latency for PostgreSQL
77+
### Oracle Example
12478

125-
Set the below credentials in the delta.py script
126-
```
127-
pgsql_un = 'postgres'
128-
pgsql_pw = 'your_password'
129-
pgsql_host = 'localhost'
130-
pgsql_port = '5432'
131-
pgsql_db = 'postgres'
79+
```bash
80+
python delta.py --db oracle --user ADMIN_USER --password YOUR_PASSWORD --host "YOUR_ORACLE_DSN" --interval 3 --period 5 --csvoutput oracle_latency.csv
13281
```
133-
Run
134-
```
135-
python3 delta.py --db postgresql --interval 3 --period 5 --csvoutput postgres_latency.csv
136-
```
137-
82+
- If you omit an argument, you will be prompted at runtime (passwords asked securely).
13883

139-
# Calculate URL Latency
84+
### PostgreSQL Example
14085

141-
Set the below parameter in the delta.py script
142-
```
143-
test_url = 'your_url'
144-
```
145-
Run
146-
```
147-
python3 delta.py --db url --interval 3 --period 5 --csvoutput url_latency.csv
86+
```bash
87+
python delta.py --db postgresql --user PG_USER --password YOUR_PASSWORD --host PG_HOST --port 5432 --database DB_NAME --interval 3 --period 5 --csvoutput postgres_latency.csv
14888
```
89+
### MySQL Example
14990

150-
# Test Cases for Each DB and URL
151-
91+
```bash
92+
python delta.py --db mysql --user MYSQL_USER --password YOUR_PASSWORD --host MYSQL_HOST --port 3306 --database DB_NAME --interval 3 --period 5 --csvoutput mysql_latency.csv
15293
```
153-
python3 delta.py --db oracle --interval 3 --period 5 --csvoutput oracle_latency.csv
94+
### URL Example
15495

155-
python3 delta.py --db mysql --interval 3 --period 5 --csvoutput mysql_latency.csv
96+
```bash
97+
python delta.py --db url --url "https://example.com" --interval 3 --period 5 --csvoutput url_latency.csv
98+
```
99+
- All arguments can also be supplied interactively if omitted.
100+
- No passwords, usernames, or hostnames are stored in the codebase.
156101

157-
python3 delta.py --db postgresql --interval 3 --period 5 --csvoutput postgres_latency.csv
102+
---
158103

159-
python3 delta.py --db url --interval 3 --period 5 --csvoutput url_latency.csv
160-
```
161104

162105
## Contributing
163106

0 commit comments

Comments
 (0)