Skip to content

perf(script): improve HPB-log-simplifier.sh#18566

Merged
nickvergessen merged 7 commits into
mainfrom
fix/noid/hpb-log-simplifier
Jul 7, 2026
Merged

perf(script): improve HPB-log-simplifier.sh#18566
nickvergessen merged 7 commits into
mainfrom
fix/noid/hpb-log-simplifier

Conversation

@Antreesy

@Antreesy Antreesy commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

☑️ Resolves

  • Fix and enhance bash script HPB-log-simplifier.sh
  • Optimize readings (in a single pass over the file in awk)
  • Fix miscounting zero sessions as 1 (wc -l on an empty string)
  • Add interrupt capture with Ctrl+C
  • Add mapping file for better structure and tracing
  • Create new files in a target directory, not in a script location
  • Fix the pattern for user sessions (was broken before)
  • Detect and group room token matches
  • Detect and group IP address matches
  • Show progress on reading
  • Improve destination files structure

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

🖌️ UI Checklist

🖼️ Screenshots / Screencasts

2026-07-06_17h55_31 image

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability is added or not needed

@Antreesy Antreesy added this to the ⛅ Next Major (35) milestone Jul 6, 2026
@Antreesy Antreesy self-assigned this Jul 6, 2026
@Antreesy Antreesy added feature: signaling 📶 Internal and external signaling backends technical debt AI assisted This PR contains AI-assisted commits labels Jul 6, 2026
Antreesy added 6 commits July 6, 2026 18:01
- Original version held the whole log in a bash string, re-scanned and re-copied it once per each user/room session and prone to broken-pipe errors on large logs.
- Rewrite as a single pass over the file in awk

- Fix miscounting zero sessions as 1 (`wc -l` on an empty string)
- Add interrupt capture with Ctrl+C
- Add mapping file for better structure and tracing
- Create new files in a target directory, not in a script location

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- Adjust the pattern to cover user sessions (was broken before)
- Trace and couple public/private tokens for same user to reduce noise in the file

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- Room tokens (e.g. "joined room/call token123") are grouped into a single room_<token>.log
- Trace rooms and related sessions in mapping.log

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- Like room tokens, client IP addresses kept unanonymized
- Lines mentioning the same IP are grouped into their own
ip/<ip>.log

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- user*.log, session*.log, client*.log and room_*.log are now located under same 'subdirectory' for easier navigation with long logs

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- The single-pass rewrite gives no feedback until it finishes
- Print "Processing: X/Y lines (Z%)" from within the awk process.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the fix/noid/hpb-log-simplifier branch from 011649f to db9ab29 Compare July 6, 2026 16:01

@nickvergessen nickvergessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems to work,

while on it, it would be good to print the helping info when no file was provided or the argument is -h or --help

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@nickvergessen nickvergessen enabled auto-merge July 7, 2026 11:31
@nickvergessen nickvergessen merged commit 8f9dd1d into main Jul 7, 2026
54 checks passed
@nickvergessen nickvergessen deleted the fix/noid/hpb-log-simplifier branch July 7, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits feature: signaling 📶 Internal and external signaling backends technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants