Skip to content

Improve log parsing, URL handling, and detailed reporting for router troubleshooting skills - #2

Merged
mouxinqq merged 1 commit into
developfrom
codex/review-skills-and-test-case-requirements-ekb2lw
Apr 12, 2026
Merged

mouxinqq merged 1 commit into
developfrom
codex/review-skills-and-test-case-requirements-ekb2lw

Conversation

@mouxinqq

Copy link
Copy Markdown
Owner

Motivation

  • Make log parsing and time-range handling more robust and flexible for real-world router logs (variable years, time-only args, tail-by-minutes).
  • Normalize worker/worker-URL presentation and matching (strip scheme, accept http/https and host:port forms) to improve readability and correctness across analyzers.
  • Enrich reports with per-window details and better select/release matching to aid diagnostics.

Description

  • Replace hardcoded year/date fallbacks with datetime.now().year and include full date in compute_time_span to avoid using stale defaults.
  • Add URL_RE patterns and broaden regexes everywhere to accept optional http(s):// and host:port forms, and add _strip_scheme helpers to consistently render worker URLs without scheme.
  • Improve select/release matching logic with request_id/alt-id keys, ID coverage metrics, time-fallback matching window, and untracked_selects tracking; expose match method and id coverage in results.
  • Add filter_file_by_recent_minutes and extend CLI --tail handling to support Nm minutes mode by time-window filtering; update troubleshoot.py to use minutes-mode filtering and to parse --tail into structured arg.
  • Enhance stat_cache_hitrate reporting: introduce build_per_window_rows, include per-5s window preview in terminal report, export per-window details to details/per_window_data.md, and pass diagnosis & time_span into detailed report output.
  • Add/extend various analyzer improvements: include DEBUG level in log_parser, add token counter and select/release integration into load analyzer, refine health analyzer IP/url parsing and recovery detection, and extend error source rules.
  • Misc: unify and tighten regexes for token/select/release/prefill events, include ts_ms reason parsing variants, and minor UI/text improvements in ASCII/Unicode charts and messages.

Testing

  • Ran automated syntax/import checks with python -m compileall across modified modules and no syntax errors were reported.
  • Executed CLI smoke invocations python troubleshoot.py --help and python stat_cache_hitrate.py --help to validate argument parsing and startup paths, both succeeded.
  • Performed automated analyzer smoke runs on sample log snippets exercising select/release matching, --tail minute filtering, and report generation; these smoke checks completed without exceptions.

Codex Task

@mouxinqq
mouxinqq merged commit 26b734b into develop Apr 12, 2026
20 of 25 checks passed

This branch had an error being deployed

1 failed deployment
Metax_ci — 4ced999b Deployed Apr 12, 2026 by mouxinqq via Trigger Jenkins for PR #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant