-
Notifications
You must be signed in to change notification settings - Fork 6
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
Follow logs using overlap #89
Follow logs using overlap #89
Conversation
54e4b29
to
47b5813
Compare
pkg/cmd/collect.go
Outdated
usr, err := user.Current() | ||
if err != nil { | ||
log.Fatal("Failed to result homedir for current user in --tempdir") |
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.
Since the error is for user.Current()
maybe we should rephrase the error message? something like
usr, err := user.Current() | |
if err != nil { | |
log.Fatal("Failed to result homedir for current user in --tempdir") | |
usr, err := user.Current() | |
if err != nil { | |
log.Fatal("Failed to get current user") |
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.
Changed to "Failed to fetch current user so could not resolve tempdir"
pkg/runner/collector_selector.go
Outdated
@@ -13,13 +13,16 @@ import ( | |||
var ( | |||
OptionalCollectorNames []string | |||
RequiredCollectorNames []string | |||
OptInCollectorNames []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.
Not sure I understand from the name what it is. Sounds very similar to OptionalCollectorNames
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.
OptIn is off by default, Optional is on by default but can be turned off.
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.
I can probably take this out as we moved the log collector to on by default
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.
Removed :)
57b5836
to
18c94b6
Compare
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.
needs a pass to rewrite the test descriptions and some comments for clarity, but looks promising.
pkg/cmd/collect.go
Outdated
collectCmd.Flags().StringVarP( | ||
&logsOutputFile, | ||
"logs-output", "l", "", | ||
"Path to the logs output file. This is required when using the opt in logs collector", |
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.
"Path to the logs output file. This is required when using the opt in logs collector", | |
"Path to the logs output file. This is required when using the logs collector", |
pkg/collectors/log_follower.go
Outdated
) | ||
|
||
// LogsCollector collects logs from repeated calls to the kubeapi with overlapping query times, | ||
// the lines are then fed into a channel, in another gorotine they are de-duplicated and written to an output file. |
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.
// the lines are then fed into a channel, in another gorotine they are de-duplicated and written to an output file. | |
// the lines are then fed into a channel, in another goroutine they are de-duplicated and written to an output file. |
pkg/loglines/dedup.go
Outdated
} | ||
|
||
//nolint:varnamelen // x and y are just two sets of lines | ||
func findIncompatableLines(x, y []*ProcessedLine) int { |
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.
Fix typo in name and add a definition of what an incompatible line is as it's extensively used:
func findIncompatableLines(x, y []*ProcessedLine) int { | |
// an incompatible line is a line that exists in x without being present at the same index in y. | |
func findIncompatibleLines(x, y []*ProcessedLine) int { |
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.
also consider renaming to something like findFirstIssueIndex
} | ||
|
||
//nolint:gocritic,varnamelen // don't want to name the return values as they should be built later, I think x, y are expressive enough names | ||
func fixLines(x, y []*ProcessedLine, issueIndex int) ([]*ProcessedLine, []*ProcessedLine, bool) { |
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.
fixLines needs a sentence or two docstring explaining what the two output line slices are and what guarantees are made about them
return loglines.MakeSliceFromLines(lines, generation), nil | ||
} | ||
|
||
var _ = Describe("Dedup AB tests", func() { |
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.
the text in each of the When
and It
calls needs to be rewritten for clarity
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.
I've gone through them if you think there needs extra let me know.
collectorInclusionType has 3 values require, includeByDefault and optIn
…ualt names - Change all to defaults and include opt in collectors for All
18c94b6
to
2668088
Compare
cff147b
to
128781e
Compare
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.
Looks good, happy to merge once we have a long run that matches the more crude method.
d7ab104
into
redhat-partner-solutions:main
Did 3000m and completely matched the crude method :) |
No description provided.