From 49602a7120a7db0dcddc1e1e047d40cd063887c3 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Fri, 30 Sep 2022 11:51:38 +0200 Subject: [PATCH] admission: decrease log chattiness The "CPULoad switching to period" was the 9th most voluminous log event source in CC. This commit reduces its verbosity. Release note: None --- pkg/util/admission/granter.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/util/admission/granter.go b/pkg/util/admission/granter.go index e8003a425a64..428ba72a7a56 100644 --- a/pkg/util/admission/granter.go +++ b/pkg/util/admission/granter.go @@ -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