I have a program that reads the following files:
cat /sys/fs/cgroup/cpu/cpuacct.usage /sys/fs/cgroup/cpu/cpu.cfs_quota_us /sys/fs/cgroup/cpu/cpu.cfs_period_us /sys/fs/cgroup/memory/memory.usage_in_bytes /sys/fs/cgroup/memory/memory.soft_limit_in_bytes /sys/fs/cgroup/memory/memory.limit_in_bytes &&grep '^\\(total_rss\\|total_cache\\) ' /sys/fs/cgroup/memory/memory.stat
On some Linux machines, it works fine. But I'm trying to make it cross-platform and I'm using Node.js. How can I get all of this info (RAM usage, CPU usage, etc) from Node in the same format as the command above?
So I basically want to know exactly what the files in the above command do, and how I can generate the same output using Node.js.