Repository navigation
refactor(structured,parsers): optimize log parsing with FieldPath interning and Extractor pattern - #928
Merged
Conversation
…n with MockNode tests
…n with MockNode tests
… with MockNode tests
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
August 31, 2026 01:55
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the log parsing architecture in KHI by replacing the FieldSetReaderTask pattern with a more efficient, direct extraction approach using Extract functions and structured.NodeReader. It also introduces structured.CompileFieldPath for optimized path traversal and updates various log parsing packages and tests to adopt this new pattern, including the addition of testlog.NewMockLog for improved testing. Documentation has been updated to reflect these architectural changes. I have no feedback to provide.
kyasbal
commented
Aug 31, 2026
…erns, and documentation
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.
Summary
This PR introduces typed log extraction optimizations and structured log parsing enhancements across all inspection log parsers in KHI:
Pre-compiled
FieldPath& Interning:structured.CompileFieldPathwithunique.Handlestring interning to avoid repeated allocations and path parsing during hot log inspection loops.CompileFieldPathdefinitions.Extractor Pattern & Typed Parsing:
NodeReader.Testing Infrastructure:
structured.MockNodeand test utilities for fast, deterministic unit testing of log parsers without JSON serialization overhead.MockNodeandcmp.Diff.Verification
make pre-commitpassed cleanly.make lint-webpassed cleanly.make test-webpassed cleanly (1066/1066 tests).make test-gopassed cleanly across all backend packages.make build-goandmake build-webpassed cleanly.