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: README.md
+44Lines changed: 44 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,48 @@ This project is a next-generation database endpoint latency benchmarking tool, p
4
4
5
5
By running YOUR own query, this tool captures every millisecond: DNS, handshake, connection pool, DB engine, result marshaling—just as your app user sees it. This is true end-to-end, *application-perceived* latency and not just network latency.
6
6
7
+
__How Latency Checks Work :__
8
+
9
+
Latency is measured as the total time taken for each test cycle—which includes the connection, SQL execution, and result fetching in a single measurement.
10
+
11
+
__Process per iteration (databases):__
12
+
13
+
1. The timer starts just before the database driver begins a query cycle. This includes any necessary database connection and the execution of the test SQL (typically `SELECT 1` or a user-provided query).
14
+
2. The timer stops immediately after the query results are fetched (i.e., after `cursor.fetchall()` returns).
15
+
3. The elapsed time is recorded as the latency for that operation, in milliseconds.
16
+
4. This measurement is appended to a list, so statistics (average, mean, p99, p90, stddev) can be calculated on all trials.
17
+
18
+
This entire measured duration includes:
19
+
20
+
- For engines like Oracle/PostgreSQL/MySQL/SQL Server:
21
+
22
+
- TCP network round-trip time (for connect & query)
23
+
- Any network stack or driver overhead
24
+
- Server-side session creation (if not pooled)
25
+
- Query parsing & planning
26
+
- SQL execution on server
27
+
- Fetching of any results (for basic `SELECT 1` it’s minimal)
28
+
- Transmission of the results back to the client
29
+
30
+
The approach does not separate out the network portion vs. SQL execution: it is an end-to-end measurement for “open (if needed) + execute + fetch”.
31
+
32
+
__For URL Latency Checks:__
33
+
34
+
- The tool uses the Python `requests` library.
35
+
36
+
- The timer starts immediately before `requests.get(url)` and stops immediately after the HTTP(S) response has been received (after the body is completely read).
37
+
38
+
- The measured latency thus includes:
39
+
40
+
- DNS resolution (if needed)
41
+
- TCP/TLS handshake
42
+
- Network round-trip(s)
43
+
- Server processing time for the request
44
+
- Transmission of the full response body
45
+
46
+
For both DBs and URL cases, it is a “total user-experienced latency” as seen by a typical client, not a fine-grained split of connection and query phases.
<imgwidth="458"alt="Screenshot 2025-07-05 at 11 03 00 PM"src="https://github.com/user-attachments/assets/d97ee854-b7ff-4ee6-af5f-7c1fe127a281" />
290
332
333
+
__Summary:__\
334
+
The latency metric reported by this tool is the full end-to-end time required to execute the test operation—from just before the action is started to just after it completes—capturing the complete delay as experienced by a real client under typical network and server conditions.
0 commit comments