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

Replace wmi queries with win32 api calls #116

Merged
merged 10 commits into from
Apr 24, 2019

Conversation

narph
Copy link

@narph narph commented Apr 18, 2019

Fixes elastic/beats#11840

Alternative to disable config option here elastic/beats#3249

Addresses high CPU load on windows

Fixes elastic/beats#11840

Addresses high CPU load on windows
@narph narph requested a review from andrewkroh April 18, 2019 15:54
@narph narph self-assigned this Apr 18, 2019
@narph narph requested a review from ruflin April 19, 2019 07:05
@narph narph added the review label Apr 19, 2019
sigar_windows.go Outdated
}
var process = Win32_Process{CommandLine: &args[0]}
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove the Win32_Process struct completely.

sigar_windows.go Outdated
if err != nil {
return nil
}
var args []string
Copy link
Member

@andrewkroh andrewkroh Apr 19, 2019

Choose a reason for hiding this comment

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

Instead of creating a variable, what about just using self.List directly?

@narph narph requested a review from andrewkroh April 23, 2019 10:28
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

LGTM

@narph narph changed the title Remove wmi queries with win32 api calls Replace wmi queries with win32 api calls Apr 23, 2019
CHANGELOG.md Outdated
@@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Added missing runtime import for FreeBSD. #104
- Handle nil command line in Windows processes. #110
- Replaced the WMI queries with win32 apis due to high CPU usage. #11840
Copy link

Choose a reason for hiding this comment

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

Should this go under unrealeased?

Copy link
Author

Choose a reason for hiding this comment

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

all good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metricbeat]System/process metricset - WmiPrvSE.exe seems to utilize more CPU on v 7.0.0
3 participants