Skip to content

Server latency tool - #41

Merged
NotTheRealWallyx merged 5 commits into
mainfrom
server-latency
Jul 9, 2026
Merged

Server latency tool#41
NotTheRealWallyx merged 5 commits into
mainfrom
server-latency

Conversation

@NotTheRealWallyx

Copy link
Copy Markdown
Owner

Changes

  • New tool added to check the latency of a server
  • Returns timing for several steps
  • Adds a score (Good, needs improvement, poor) depending on the score
  • Updated isort / back configuration to not collide on imports
  • Bump version to 0.0.3 for release

@NotTheRealWallyx NotTheRealWallyx self-assigned this Jul 9, 2026
@NotTheRealWallyx NotTheRealWallyx added the enhancement New feature or request label Jul 9, 2026
Copilot AI review requested due to automatic review settings July 9, 2026 08:56
@NotTheRealWallyx
NotTheRealWallyx merged commit 9f2a215 into main Jul 9, 2026
3 checks passed
@NotTheRealWallyx
NotTheRealWallyx deleted the server-latency branch July 9, 2026 09:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Website Latency Check” tool to the CTRL_Node CLI to measure and display end-to-end website connection/request latency broken down by phase (DNS, TCP, TLS, TTFB, download), and rates responsiveness using a TTFB-based score.

Changes:

  • Introduces LatencyCheck module, integrates it into the main interactive menu, and adds unit tests for the new behavior.
  • Adds rate_ttfb() helper and associated tests for the TTFB rating thresholds.
  • Updates README feature list, adds isort config alignment, and bumps package version to 0.0.3.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/common/modules/test_module_utils.py Adds unit tests for the new rate_ttfb() helper.
tests/common/modules/test_latency.py Adds unit tests covering LatencyCheck initialization, measurement, and output formatting.
README.md Documents the new Website Latency Check feature.
pyproject.toml Bumps version to 0.0.3 and adds [tool.isort] profile configuration.
ctrl_node/ctrl_node.py Adds a new menu option to run the Website Latency Check tool.
ctrl_node/common/modules/module_utils.py Adds rate_ttfb() helper used by the latency tool.
ctrl_node/common/modules/latency.py Implements LatencyCheck with phased timing, request execution, and result display.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +43 to +46
address_info = self.time_phase(
"DNS lookup", lambda: socket.getaddrinfo(self.host, self.port)
)
self.ip_address = address_info[0][4][0]
Comment on lines +55 to +63
if self.use_tls:
context = ssl.create_default_context()
sock = self.time_phase(
"TLS handshake",
lambda: context.wrap_socket(sock, server_hostname=self.host),
)

self.request_content(sock)
sock.close()
Comment on lines +93 to +98
request = (
f"GET {self.path} HTTP/1.1\r\n"
f"Host: {self.host}\r\n"
"Connection: close\r\n"
"\r\n"
).encode()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants