cgroup-stats
v1.0.1
Published
Reading CGroup container usage stats
Downloads
20
Maintainers
Readme
cgroup-stats
Node Module for reading Control Group usage stats
Currently this reads the following data:
- memory.usage_in_bytes - current usage for memory
- memory.max_usage_in_bytes - max memory usage recorded
- cpuacct.stat.user - time spent by tasks of the cgroup in user mode
- cpuacct.stat.system - time spent by tasks of the cgroup in kernel mode
This only works on Linux operating systems
Usage
var cgroupStats = require('cgroup-stats');
cgroupStats(function (error, data) {
console.log(data.memory.usage_in_bytes);
console.log(data.memory.max_usage_in_bytes);
console.log(data.cpuacct.stat.user);
console.log(data.cpuacct.stat.system);
});
License
Code licensed under the MIT license. See LICENSE
file for terms.