Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Add process collector #24

Merged
merged 5 commits into from
Mar 29, 2016
Merged

Add process collector #24

merged 5 commits into from
Mar 29, 2016

Conversation

olivielpeau
Copy link
Member

  • New collector to retrieve info on the top processes running, in a format
    that is compatible with the legacy processes check of the agent.
    Supports Linux and OS X for now.
  • Flags to select/exclude the collectors to run

- New collector to retrieve info on the top processes running, in a format
that is compatible with the legacy `processes` check of the agent.
Supports Linux and OS X for now.
- Flags to select/exclude the collectors to run
}

var options struct {
var options = struct {
only SelectedCollectors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include?


// Name processes "kernel" if they're a kernel thread
func postProcess(processInfos []*ProcessInfo) {
pidHash := buildPIDHash(processInfos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the processInfo's are not precisely a snapshot of the process table due to the fact that while we iterate the table to get the info - this table might change, I'm therefore (quite mildly) concerned that it could leave a slightly tainted table that wouldn't always lead to 1 or what would be worse some weird loop.

We could maybe add a maximum depth isKernelThread might go before deciding it's NOT a kernel thread. In general kernel threads would have a depth of 2 maximum. I'm sure if we go 4 or 5 levels into the recursion we can be certain it's not a kernel thread.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, hadn't thought about that.

Addressed this by adding a recursion limit, let me know what you think.

@truthbk
Copy link
Member

truthbk commented Mar 29, 2016

👍

@olivielpeau olivielpeau merged commit 618958b into master Mar 29, 2016
@olivielpeau olivielpeau deleted the olivielpeau/add-process-info branch March 29, 2016 14:29
@olivielpeau olivielpeau added this to the 5.8.0 agent milestone Apr 4, 2016
hush-hush pushed a commit that referenced this pull request Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants