Skip to content

Commit

Permalink
cluster: check add CPU frequency check output (#1663)
Browse files Browse the repository at this point in the history
  • Loading branch information
srstack authored Dec 13, 2021
1 parent b01e507 commit 3f0c568
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pkg/cluster/operation/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,23 @@ func checkCPU(opt *CheckOptions, cpuInfo *sysinfo.CPU) []*CheckResult {
}

// check for CPU frequency governor
if cpuInfo.Governor != "" && cpuInfo.Governor != "performance" {
if cpuInfo.Governor != "" {
if cpuInfo.Governor != "performance" {
results = append(results, &CheckResult{
Name: CheckNameCPUGovernor,
Err: fmt.Errorf("CPU frequency governor is %s, should use performance", cpuInfo.Governor),
})
} else {
results = append(results, &CheckResult{
Name: CheckNameCPUGovernor,
Msg: fmt.Sprintf("CPU frequency governor is %s", cpuInfo.Governor),
})
}
} else {
results = append(results, &CheckResult{
Name: CheckNameCPUGovernor,
Err: fmt.Errorf("CPU frequency governor is %s, should use performance", cpuInfo.Governor),
Err: fmt.Errorf("Unable to determine current CPU frequency governor policy"),
Warn: true,
})
}

Expand Down

0 comments on commit 3f0c568

Please sign in to comment.