feat(bufferbloat): parse, log, and highlight under-load latency + pac…#9
Merged
GoWithitRoger merged 1 commit intomainfrom Aug 11, 2025
Merged
feat(bufferbloat): parse, log, and highlight under-load latency + pac…#9GoWithitRoger merged 1 commit intomainfrom
GoWithitRoger merged 1 commit intomainfrom
Conversation
…ket loss; compute bufferbloat deltas Implements Tickets #1–#4 to integrate bufferbloat observability, thresholds, parsing, logging, and tests. - config.py - add LATENCY_UNDER_LOAD_THRESHOLD (ms) and SPEEDTEST_PACKET_LOSS_THRESHOLD (%) - add BUFFERBLOAT_DELTA_THRESHOLD (ms) for idle→load delta highlighting - main.py - SpeedResults: extend TypedDict with: - local_latency_down_load_ms, local_latency_up_load_ms, local_packet_loss_pct - run_local_speed_test_task(): - parse Ookla JSON: download.latency.iqm, upload.latency.iqm, packetLoss (with .get defaults) - include parsed metrics in return dict - log_results(): - include new fields in CSV: Local_Load_Down_ms, Local_Load_Up_ms, Local_Pkt_Loss_Pct - print bufferbloat lines in console with thresholds: - Latency (Download Load), Latency (Upload Load), Speedtest Packet Loss - add calculated deltas to CSV/console: - Download_Bufferbloat_ms, Upload_Bufferbloat_ms (computed vs idle WAN RTT) - consistent float formatting (CSV 3dp; console 2dp for latency, 2dp for %) - perform_checks(): - compute bufferbloat deltas: (under-load latency − idle latency) for down/up - run_speed_test_task(): - improve waiting logic by waiting for the results table (robustness for selenium flow) - minor CSV formatting simplification for the data row list comprehension tests: - tests/test_core.py - update SPEEDTEST_JSON_OUTPUT to include latency.iqm and packetLoss - assert parsing of new metrics - add test_local_speed_test_parsing_missing_keys (defaults to 0.0 without crash) - tests/test_logging.py - extend MOCK_DATA_COMPLETE with new metrics - test_log_results_csv_creation: assert headers include new fields; data row contains “75.500” - test_log_results_console_output_highlighting: - set thresholds for bufferbloat - assert red highlighting for anomalous load latencies and packet loss - add boundary test (equal-to-threshold NOT highlighted) - add precision tests: - CSV: 3dp checks for new fields - console: 2dp for latency and packet loss - tests/test_selenium_tasks.py - remains green after switching to table-based wait (ensures stable speed test flow) - (adjust mocks to reflect new waiting behavior if needed) chore: lint, type-check, and verification - ty check: All checks passed - ruff check: All checks passed - pytest: full suite passes locally Refs: Ticket #1 (config/models), Ticket #2 (Ookla parsing), Ticket #3 (logging/reporting), Ticket #4 (tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ket loss; compute bufferbloat deltas
Implements Tickets #1–#4 to integrate bufferbloat observability, thresholds, parsing, logging, and tests.
tests:
chore: lint, type-check, and verification
Refs: Ticket #1 (config/models), Ticket #2 (Ookla parsing), Ticket #3 (logging/reporting), Ticket #4 (tests)