perf(script): improve HPB-log-simplifier.sh#18566
Merged
Merged
Conversation
- 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>
011649f to
db9ab29
Compare
nickvergessen
approved these changes
Jul 7, 2026
nickvergessen
left a comment
Member
There was a problem hiding this comment.
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>
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.
☑️ Resolves
HPB-log-simplifier.shwc -lon an empty string)AI (if applicable)
🖌️ UI Checklist
🖼️ Screenshots / Screencasts
🏁 Checklist
docs/has been updated or is not required