Skip to content

Separate out linux & windows implementation of CollectSystemInfo()#5341

Merged
derekwbrown merged 3 commits into
masterfrom
db/process_system_info_win
May 11, 2020
Merged

Separate out linux & windows implementation of CollectSystemInfo()#5341
derekwbrown merged 3 commits into
masterfrom
db/process_system_info_win

Conversation

@derekwbrown

Copy link
Copy Markdown
Contributor

(do not merge yet. Needs associated gohai change to be merged first)

On windows, don't use WMI, use gohai implementation that collects
same information (and can gracefully fail when some info isn't
available, e.g. in a container) .

Allows process agent to start in a Nano container.

Requires related gohai change.

Motivation

allow process agent to run on Nano

@derekwbrown
derekwbrown requested a review from a team April 15, 2020 05:46
@derekwbrown derekwbrown added this to the 7.20.0 milestone Apr 16, 2020
@derekwbrown
derekwbrown force-pushed the db/process_system_info_win branch 3 times, most recently from 1fdc853 to 7f7765a Compare April 17, 2020 06:12
Comment thread pkg/process/checks/system_info_windows.go Outdated
Comment on lines +43 to +44
PhysicalId: "",
CoreId: "",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it okay to lose these fields?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

those weren't being filled in by the underlying gopsutil anyway

clockSpeed, _ := strconv.ParseInt(cpuInfo["mhz"], 10, 64)
l2Cache, _ := strconv.ParseInt(cpuInfo["cache_size_l2"], 10, 64)
cpus := make([]*model.CPUInfo, 0)
for i := int64(0); i < physCount; i++ {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This assumes all CPUs installed are equal, which might not be the case. Can this be a problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you have multiple CPUs they have to be equal.

On windows, don't use WMI, use gohai implementation that collects
same information (and can gracefully fail when some info isn't
available, e.g. in a container) .

Allows process agent to start in a Nano container.

Requires related gohai change.
@derekwbrown
derekwbrown force-pushed the db/process_system_info_win branch from 7f7765a to 07bb484 Compare May 5, 2020 15:26
albertvaka
albertvaka previously approved these changes May 6, 2020
remove extra import

Update pkg/process/checks/system_info_windows.go

Co-authored-by: Albert Vaca <[email protected]>
albertvaka added a commit that referenced this pull request May 11, 2020
Process Agent was fixed to work on Nano in #5341
@derekwbrown
derekwbrown merged commit 87b1f86 into master May 11, 2020
@derekwbrown
derekwbrown deleted the db/process_system_info_win branch May 11, 2020 19:44
albertvaka added a commit that referenced this pull request May 12, 2020
Process Agent was fixed to work on Nano in #5341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants