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

Suggestion: Expose Paging stats for windows #399

Open
mmoura85 opened this issue Jul 14, 2017 · 2 comments
Open

Suggestion: Expose Paging stats for windows #399

mmoura85 opened this issue Jul 14, 2017 · 2 comments

Comments

@mmoura85
Copy link

It would be useful to add an additional struct for the performance information on paging for Windows, similar to the swap struct.

I'am happy to submit a PR for this. Also there are 3 fields: HandleCount, ProcessCount, ThreadCount that could potentially sit with another struct.

Here is the documentation that I'am referring to.

@shirou
Copy link
Owner

shirou commented Jul 14, 2017

gopsutil already use GlobalMemoryStatusEx to get memory and it includes paging info (https://github.com/shirou/gopsutil/blob/master/mem/mem_windows.go#L21). but yes, it is not implemented yet.

System wide HandleCount and ThreadCount is not provided yet to other platforms, I think adding new value should be considered. If you send PR with all of the platforms, at least Linux, darwin and FreeBSD, I can merge it easily.

@mmoura85
Copy link
Author

Ok, I will add HandleCount and ThreadCount to the VirtualMemoryStat struct and look into getting both those values for the other platforms, though I'm not familiar with some of them.

As for the paging data being returned from GlobalMemoryStatusEx, please note that according to the documentation that it may not always be the system wide value, as that function will return the lesser of either the system wide value or the current process.

Also I can get the page table size for windows and populate the pageTables field in the VirtualMemoryStat struct. I just want to confirm that if you prefer the standard for of measurement to be bytes? as the value returned as megabytes?

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

No branches or pull requests

3 participants