-
Notifications
You must be signed in to change notification settings - Fork 1
feat: increase Drain tree depth from 4 to 30 #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ type DrainParser struct { | |
| // NewDrainParser creates a DrainParser with default Drain parameters. | ||
| func NewDrainParser() (*DrainParser, error) { | ||
| d, err := drain3.NewDrain( | ||
| drain3.WithDepth(4), | ||
| drain3.WithDepth(30), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Increasing Useful? React with 👍 / 👎. |
||
| drain3.WithSimTh(0.4), | ||
| drain3.WithExtraDelimiter([]string{"|", "=", ","}), | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While changing the depth, this is a good opportunity to address the magic numbers in this block of parameters. The values
30,0.4, and the delimiter slice are hardcoded. Defining them as named, package-level constants/variables would improve readability and maintainability.Additionally, the delimiter slice
[]string{"|", "=", ","}is duplicated inpkg/pattern/parser.go. This should be defined in one place to avoid inconsistencies.I suggest defining these at the package level:
Then, the
NewDraincall would be cleaner and safer:This would also require updating
pkg/pattern/parser.goto use the new shareddrainExtraDelimitersvariable.