Skip to content
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

Improve process code in probe #272

Merged
merged 1 commit into from
Jun 23, 2015

Conversation

tomwilkie
Copy link
Contributor

  • move pidtree into its own module
  • desegregate pidtree into tree, walker and reporter
  • extend tests
  • put command line in the process metadata

might help towards #238

@tomwilkie tomwilkie force-pushed the process-details branch 2 times, most recently from be6c4d7 to 574379f Compare June 22, 2015 18:00
@@ -43,7 +43,7 @@ func (t *Tagger) Tag(r report.Report) (report.Report, error) {
return r, nil
}

func (t *Tagger) tag(pidTree tag.PIDTree, topology *report.Topology) {
func (t *Tagger) tag(pidTree process.Tree, topology *report.Topology) {

This comment was marked as abuse.

)

// Walk
var Walk = func(procRoot string, f func(*Process)) error {

This comment was marked as abuse.

}
if val, ok := nmd["ppid"]; ok {
rows = append(rows, Row{"Parent PID", val, ""})
for _, tuple := range []struct{ key, human string }{

This comment was marked as abuse.

This comment was marked as abuse.

if err != nil {
continue
}
splits := strings.Split(string(stat), " ")

This comment was marked as abuse.


cmdline := ""
if cmdlineBuf, err := ReadFile(path.Join(procRoot, filename, "cmdline")); err == nil {
cmdlineBuf = bytes.Replace(cmdlineBuf, []byte{'\000'}, []byte{' '}, -1)

This comment was marked as abuse.

This comment was marked as abuse.

- Move pidtree to its own module and disaggregate it into tree, walker and reporter.
- Extend testing for probe/process
- Extend process metadata; add command line & # threads.
@paulbellamy
Copy link
Contributor

LGTM

tomwilkie added a commit that referenced this pull request Jun 23, 2015
@tomwilkie tomwilkie merged commit d3d10fe into weaveworks:master Jun 23, 2015
@tomwilkie tomwilkie deleted the process-details branch June 23, 2015 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants