Skip to content

Commit

Permalink
admission: decrease log chattiness
Browse files Browse the repository at this point in the history
The "CPULoad switching to period" was the 9th most voluminous log
event source in CC.

This commit reduces its verbosity.

Release note: None
  • Loading branch information
knz committed Sep 30, 2022
1 parent a87b3d0 commit 49602a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/util/admission/granter.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,9 +929,11 @@ func (coord *GrantCoordinator) GetWorkQueue(workKind WorkKind) *WorkQueue {
func (coord *GrantCoordinator) CPULoad(runnable int, procs int, samplePeriod time.Duration) {
ctx := coord.ambientCtx.AnnotateCtx(context.Background())

if coord.lastCPULoadSamplePeriod != 0 && coord.lastCPULoadSamplePeriod != samplePeriod &&
KVAdmissionControlEnabled.Get(&coord.settings.SV) {
log.Infof(ctx, "CPULoad switching to period %s", samplePeriod.String())
if log.V(1) {
if coord.lastCPULoadSamplePeriod != 0 && coord.lastCPULoadSamplePeriod != samplePeriod &&
KVAdmissionControlEnabled.Get(&coord.settings.SV) {
log.Infof(ctx, "CPULoad switching to period %s", samplePeriod.String())
}
}
coord.lastCPULoadSamplePeriod = samplePeriod

Expand Down

0 comments on commit 49602a7

Please sign in to comment.