Skip to content

Update README.md #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 32 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DELTA - FastAPI based WebApp to Test Database Latency (NEW, 2025)

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

https://github.com/user-attachments/assets/e3eaf179-914b-4c17-bc47-35f17e86aee0
Built with ❤️ using FastAPI.


## Clone Repository ##
Expand Down Expand Up @@ -56,95 +56,43 @@ http://localhost:8000

![Screenshot 2025-07-03 at 11 26 30 PM](https://github.com/user-attachments/assets/f1b17fb8-f637-4b86-95c9-52dd0b6e2067)

### 5. API Usage via Curl/CLI Example:
### 5. Default SQL : API Usage via Curl/CLI MySQL Example
```bash
curl -u admin:change_this -X POST http://localhost:8000/api/test-latency -d dbtype=mysql -d host=localhost -d port=3390 -d username=testuser -d password="YOurP@ssword#12" -d database=testdb -d interval=1 -d period=10 | jq .
```
curl -u admin:change_this -X POST http://localhost:8000/api/test-latency \
-d dbtype=mysql \
-d host=localhost \
-d port=3390 \
-d username=testuser \
-d password="YourPassword1##" \
-d database=testdb \
-d interval=1 \
-d period=10 \
| jq .
```

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1260 100 1145 100 115 107 10 0:00:11 0:00:10 0:00:01 259
{
"success": true,
"error": null,
"latency_stats": {
"p99": 65.00130997534143,
"p90": 64.45847470022272,
"avg": 59.44308740145061,
"stddev": 3.661004661748353,
"mean": 59.44308740145061,
"runs": 10
},
"details": [
{
"timestamp": "2025-07-04 01:18:22",
"latency_ms": 61.802583004464395,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:23",
"latency_ms": 61.06654200993944,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:24",
"latency_ms": 64.39145799959078,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:25",
"latency_ms": 53.58212499413639,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:26",
"latency_ms": 65.06162500591017,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:27",
"latency_ms": 57.83200000587385,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:29",
"latency_ms": 54.59125000925269,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:30",
"latency_ms": 57.854083002894185,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:31",
"latency_ms": 60.93537498963997,
"success": true,
"error": null
},
{
"timestamp": "2025-07-04 01:18:32",
"latency_ms": 57.31383299280424,
"success": true,
"error": null
}
]
}
### 6. Custom User SQL : API Usage via Curl/CLI MySQL Example

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:

```bash
curl -u admin:change_this -X POST http://localhost:8000/api/test-latency \
-d dbtype=mysql \
-d host=localhost \
-d port=3390 \
-d username=testuser \
-d password="YourPassword1##" \
-d database=testdb \
-d interval=1 \
-d period=10 \
-d custom_sql="SELECT * FROM mytable WHERE status='ACTIVE' LIMIT 10" \
| jq .
```

## Command-Line (delta.py) Usage — Secure, No Stored Credentials
- If `custom_sql` is included (and not empty), that query is used for measuring latency (instead of `SELECT 1`).

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.
- All other parameters stay the same as before.

- You can enter multi-line SQL in the terminal by wrapping it in quotes, or you can pipe in a file with `-d custom_sql="$(cat myquery.sql)"`.

## Databases Supported 🔌 :

Expand Down