Skip to content

Commit 1f532ba

Browse files
committed
Log usage
1 parent 262fc17 commit 1f532ba

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

components/ws-daemon/pkg/cpulimit/cfs_v2.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strings"
1414
"time"
1515

16+
"github.com/gitpod-io/gitpod/common-go/log"
1617
"golang.org/x/xerrors"
1718
)
1819

@@ -28,6 +29,7 @@ func (basePath CgroupV2CFSController) Usage() (CPUTime, error) {
2829
}
2930

3031
func (basePath CgroupV2CFSController) SetLimit(limit Bandwidth) (changed bool, err error) {
32+
log.Info("Setting limit to %s", basePath)
3133
quota, period, err := basePath.readCpuMax()
3234
if err != nil {
3335
return false, xerrors.Errorf("failed to read cpu max from %s: %w", basePath, err)

components/ws-daemon/pkg/cpulimit/dispatch.go

+2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,10 @@ func newCFSController(basePath, cgroupPath string) (CFSController, error) {
227227

228228
switch {
229229
case err == nil:
230+
log.Info("Using cgroup v2 cfs controller for cpu limiting")
230231
return CgroupV2CFSController(filepath.Join(basePath, cgroupPath)), nil
231232
case err == os.ErrNotExist:
233+
log.Info("Using cgroup v1 cfs controller for cpu limiting")
232234
return CgroupV1CFSController(filepath.Join(basePath, "cpu", cgroupPath)), nil
233235
default:
234236
return nil, err

0 commit comments

Comments
 (0)