Closed rjbergTU closed 3 years ago
hi! Sorry for taking so long to reply. I think your idea is a good one, and I think your PR is the right approach. I actually think this approach should be taken more broadly for other structs to make it possible to parse data from custom sources (files mounted outside of /proc
for example)
I added this to Meminfo and KernelStats as well.
Could you merge it? Something I am working on is already using this functionality.
It is merged, so I am closing this issue.
I think it would be a good idea if cpuinfo could be collected from another source than the hardcoded /proc/cpuinfo.
For example, if I want to parse a file I got from another system I could use this to process the information. It can also help with integration testing, because I would be able to set a cpuinfo other than the one on the currently running system for testing.
I made a PR for this already:
https://github.com/eminence/procfs/pull/116
Thanks in advance for considering this.