Skip to content

Enhance log parsing and troubleshoot analysis: robust URL handling, tail-by-minutes, improved select/release matching and reporting - #1

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

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

Conversation

@mouxinqq

Copy link
Copy Markdown
Owner

Motivation

  • Make URL matching and worker display robust to https, hostnames and optional ports and consistently strip schemes for human-friendly reporting.
  • Support tailing by a recent time window (minutes) using log timestamps instead of approximated line counts.
  • Improve select/release correlation using available IDs and a safe fallback by worker+time to reduce false unmatched/miscounts.
  • Fix brittle defaults for missing dates/times and extend logging level recognition to include DEBUG.

Description

  • Introduced a reusable URL_RE pattern and replaced many literal http://... regexes across log_parser.py, stat_cache_hitrate.py, and analyzer modules to accept optional http(s)://, hostnames, IPs and optional ports.
  • Added _strip_scheme utility in multiple modules and used it to present worker URLs without http(s):// in reports and diagnostics.
  • Replaced hardcoded fallback years/dates in complete_time_arg with datetime.now().year and dynamic defaults.
  • Added filter_file_by_recent_minutes and changed CLI --tail handling in troubleshoot.py to accept Nm (minutes) or line counts; Nm now filters by timestamp window.
  • Reworked select/release matching in log_parser.match_select_release: build a key via request_id (preferred) or req_id/trace_id/session_id, report id_coverage, collect untracked_selects, and add a worker_time_fallback match within a configurable fallback_window_s. Added _parse_ts_safe and safer timestamp handling.
  • Extended match outputs (untracked_selects, id_coverage, match_method) and updated analyzers/reports to respect cases with no correlatable IDs (show Delta as N/A and avoid misreporting).
  • Improved token/counter analysis: included additional H11 lines in match_select_release usage, expanded token diagnostics in load analyzer, and added token-leak diagnoses.
  • Broadened LEVEL_RE to include DEBUG and tightened several regexes to avoid accidental captures; updated parsing and formatting usages across trace.py, health.py, cache.py, load.py, and stat_cache_hitrate.py.
  • Miscellaneous: added imports (re, timedelta) where needed and small refactors to keep parsing robust and human-readable.

Testing

  • No automated tests were added or executed as part of this change.

Codex Task

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

This branch had an error being deployed

1 failed deployment
Metax_ci 5346b515 Deployed Apr 12, 2026 by mouxinqq via Trigger Jenkins for PR #1
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