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
Collector for RRD data #290
Conversation
7cb3613
to
8ee4a09
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.
4 issues found.
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.
4 issues found.
|
||
func getFilesFromPod(ctx context.Context, client *kubernetes.Clientset, c *Collector, podName string, containerName string, namespace string, containerPath string) ([]byte, []byte, error) { | ||
command := []string{"tar", "-C", filepath.Dir(containerPath), "-cf", "-", filepath.Base(containerPath)} | ||
req := client.CoreV1().RESTClient().Post().Resource("pods").Name(podName).Namespace(namespace).SubResource("exec") |
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.
Avoid unnecessary use of client-go restClient
pkg/rrd/rrd_c.go
Outdated
return append(args, makeArgs(e.args)...) | ||
} | ||
|
||
func parseInfoKey(ik string) (kname, kkey string, kid 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.
Naked returns harm the readability of code, especially in long functions.
pkg/rrd/rrd_c.go
Outdated
return r | ||
} | ||
|
||
func parseGraphInfo(i *C.rrd_info_t) (gi GraphInfo, img []byte) { |
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.
Naked returns harm the readability of code, especially in long functions.
897a7a6
to
a384420
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.
8 issues found.
836d80c
to
886720e
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.
1 issues found.
@@ -42,138 +42,154 @@ func isExcluded(excludeVal multitype.BoolOrString) (bool, error) { | |||
return parsed, nil | |||
} | |||
|
|||
func (c *Collector) RunCollectorSync(globalRedactors []*troubleshootv1beta2.Redact) (map[string][]byte, error) { | |||
var unRedacted map[string][]byte | |||
func (c *Collector) RunCollectorSync(globalRedactors []*troubleshootv1beta2.Redact) (result map[string][]byte, err error) { |
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.
Naked returns harm the readability of code, especially in long functions.
ce29310
to
265f9e1
Compare
376e48b
to
72e0708
Compare
72e0708
to
5a1321d
Compare
Example collector and analyzer
Load value is normalized using the number of CPUs found in the RRD data.