-
Notifications
You must be signed in to change notification settings - Fork 762
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
Get rid of dependency on deprecated WMIC on Windows #2771
Comments
This comment was marked as spam.
This comment was marked as spam.
It appears the current implementation is broken anyway. If you call {
totalBytes: 25438089216,
freeBytes: 7435272192,
usedBytes: 18002817024,
mainProcessBytes: -1,
childProcessesBytes: 14073856
} Im not quite sure how this has gone unoticed, the test suite for it fails because of this. Is the test suite not regularly run on windows? |
@NathanSavageKaimai thanks for bringing this up, we really should run the unit tests on Windows as well. |
@janbuchar ive been playing around with this and I have a solution that works but ive hit a bit of a snag. The modern alternative to WMIC that Microsoft reccomends is the powershell command processLister = spawn('powershell', [
'-NoProfile',
'-Command',
'Get-CimInstance Win32_Process | Format-Table ProcessId,ParentProcessId,WorkingSetSize,Name',
]); unfortunately this takes about 66% longer to execute than WMIC did. ~500+ms vs ~300+ms. Is this a trade off you can accept or should I keep looking? Theres a module i found called ps-list by sindresorhus that has a custom binary that would likley be faster but obviously it would add a third party dependancy. If the powershell solution is acceptable, a slight test modification is needed in the test suite as the Snapshotter ".get[.*]Sample limits amount of samples" test doesnt run long enough for the function to run twice and thus throws a false positive. Let me know what you think. : ) |
this issue should now be resolved but only when using the |
LocalEventManager
to get memory usage (or cpu? doesn't matter...)The text was updated successfully, but these errors were encountered: