add cpu.cfs_period_us support
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
This commit is contained in:
parent
eef8989683
commit
cec0cd69cb
1 changed files with 10 additions and 2 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
type SysInfo struct {
|
||||
MemoryLimit bool
|
||||
SwapLimit bool
|
||||
CpuCfsPeriod bool
|
||||
CpuCfsQuota bool
|
||||
IPv4ForwardingDisabled bool
|
||||
AppArmor bool
|
||||
|
@ -50,8 +51,15 @@ func New(quiet bool) *SysInfo {
|
|||
logrus.Warnf("%v", err)
|
||||
}
|
||||
} else {
|
||||
_, err1 := ioutil.ReadFile(path.Join(cgroupCpuMountpoint, "cpu.cfs_quota_us"))
|
||||
sysInfo.CpuCfsQuota = err1 == nil
|
||||
_, err := ioutil.ReadFile(path.Join(cgroupCpuMountpoint, "cpu.cfs_period_us"))
|
||||
logrus.Warnf("%s", cgroupCpuMountpoint)
|
||||
sysInfo.CpuCfsPeriod = err == nil
|
||||
if !sysInfo.CpuCfsPeriod && !quiet {
|
||||
logrus.Warnf("WARING: Your kernel does not support cgroup cfs period")
|
||||
}
|
||||
_, err = ioutil.ReadFile(path.Join(cgroupCpuMountpoint, "cpu.cfs_quota_us"))
|
||||
logrus.Warnf("%s", cgroupCpuMountpoint)
|
||||
sysInfo.CpuCfsQuota = err == nil
|
||||
if !sysInfo.CpuCfsQuota && !quiet {
|
||||
logrus.Warn("Your kernel does not support cgroup cfs quotas")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue