jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.63k stars 179 forks source link

Add HugePages info to AreaForNode #371

Closed Traumeel closed 3 weeks ago

Traumeel commented 2 months ago

I am using Topology functionality to get info about cpu and mem in NUMA architecture. What I am currently missing is data about HugePages. At least HugePages_Total, HugePages_Free and currently set size.

Maybe you are willing to extend logic here

https://github.com/jaypipes/ghw/blob/main/pkg/memory/memory_linux.go#L63

and add info about HugePages.

In case I am missing something and this info can be obtained by some other means in the lib, please feel free to redirect me.

Cheers!

ffromani commented 1 month ago

I think we can do this, should fit in the goals as we reporting machine properties. @jaypipes thoughts?

jaypipes commented 1 month ago

@ffromani @Traumeel apologies for not responding earlier! I must have missed this in my inbox :(

Yes, this seems like a straightforward enhancement. @Traumeel would you like to submit this feature or would you like one of us to handle it?

ffromani commented 1 month ago

No probs @jaypipes I noticed late as well :) Just in case, I'd be happy to help as backup.

Traumeel commented 3 weeks ago

@ffromani @Traumeel apologies for not responding earlier! I must have missed this in my inbox :(

@jaypipes No worries, all good)

Yes, this seems like a straightforward enhancement. @Traumeel would you like to submit this feature or would you like one of us to handle it?

I did PR, please have a look.

jaypipes commented 3 weeks ago

Closing this one out. The next release of ghw will include your feature, @Traumeel, thank you! :)