Skip to content

Commit

Permalink
chore: a few detail and lengthy log level downgraded to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
h-w-chen committed Jan 24, 2025
1 parent fb6d1d8 commit 9a51efa
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
4 changes: 3 additions & 1 deletion pkg/agent/qrm-plugins/cpu/dynamicpolicy/state/state_mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (s *cpuPluginState) SetMachineState(numaNodeMap NUMANodeMap) {
defer s.Unlock()

s.machineState = numaNodeMap.Clone()
klog.InfoS("[cpu_plugin] Updated cpu plugin machine state", "numaNodeMap", numaNodeMap.String())
if klog.V(6).Enabled() {
klog.InfoS("[cpu_plugin] Updated cpu plugin machine state", "numaNodeMap", numaNodeMap.String())
}
}

func (s *cpuPluginState) SetNUMAHeadroom(numaHeadroom map[int]float64) {
Expand Down
6 changes: 4 additions & 2 deletions pkg/agent/qrm-plugins/memory/dynamicpolicy/state/state_mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ func (s *memoryPluginState) SetMachineState(numaNodeResourcesMap NUMANodeResourc
defer s.Unlock()

s.machineState = numaNodeResourcesMap.Clone()
klog.InfoS("[memory_plugin] Updated memory plugin machine state",
"numaNodeResourcesMap", numaNodeResourcesMap.String())
if klog.V(6).Enabled() {
klog.InfoS("[memory_plugin] Updated memory plugin machine state",
"numaNodeResourcesMap", numaNodeResourcesMap.String())
}
}

func (s *memoryPluginState) SetNUMAHeadroom(numaHeadroom map[int]int64) {
Expand Down
5 changes: 4 additions & 1 deletion pkg/agent/resourcemanager/reporter/cnr/cnrreporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ func (c *cnrReporterImpl) tryUpdateCNRStatus(ctx context.Context,
"status": "success",
})...)

klog.Infof("patch cnr status success old status: %#v,\n new status: %#v", originCNR.Status, cnr.Status)
if klog.V(6).Enabled() {
klog.Infof("patch cnr status success old status: %#v,\n new status: %#v", originCNR.Status, cnr.Status)
}

c.latestUpdatedCNR = cnr.DeepCopy()

// notify cnr status update
Expand Down
4 changes: 3 additions & 1 deletion pkg/agent/sysadvisor/plugin/qosaware/resource/cpu/advisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ func (cra *cpuResourceAdvisor) updateWithIsolationGuardian(tryIsolation bool) (

cra.advisorUpdated = true

klog.Infof("[qosaware-cpu] region map: %v", general.ToString(cra.regionMap))
if klog.V(6).Enabled() {
klog.Infof("[qosaware-cpu] region map: %v", general.ToString(cra.regionMap))
}

// assemble provision result from each region
calculationResult, err := cra.assembleProvision()
Expand Down
12 changes: 10 additions & 2 deletions pkg/agent/sysadvisor/plugin/qosaware/server/cpu_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ func (cs *cpuServer) getAndSyncCheckpoint(ctx context.Context, client cpuadvisor
_ = cs.emitter.StoreInt64(cs.genMetricsName(metricServerLWGetCheckpointFailed), int64(cs.period.Seconds()), metrics.MetricTypeNameCount)
return fmt.Errorf("got nil checkpoint")
}
klog.Infof("[qosaware-server-cpu] got checkpoint: %v", general.ToString(getCheckpointResp.Entries))

if klog.V(6).Enabled() {
klog.Infof("[qosaware-server-cpu] got checkpoint: %v", general.ToString(getCheckpointResp.Entries))
}

_ = cs.emitter.StoreInt64(cs.genMetricsName(metricServerLWGetCheckpointSucceeded), int64(cs.period.Seconds()), metrics.MetricTypeNameCount)

cs.syncCheckpoint(ctx, getCheckpointResp, safeTime)
Expand Down Expand Up @@ -230,7 +234,11 @@ func (cs *cpuServer) getAndPushAdvice(client cpuadvisor.CPUPluginClient, server
_ = cs.emitter.StoreInt64(cs.genMetricsName(metricServerLWSendResponseFailed), int64(cs.period.Seconds()), metrics.MetricTypeNameCount)
return fmt.Errorf("send listWatch response failed: %w", err)
}
klog.Infof("[qosaware-server-cpu] sent listWatch resp: %v", general.ToString(lwResp))

if klog.V(6).Enabled() {
klog.Infof("[qosaware-server-cpu] sent listWatch resp: %v", general.ToString(lwResp))
}

_ = cs.emitter.StoreInt64(cs.genMetricsName(metricServerLWSendResponseSucceeded), int64(cs.period.Seconds()), metrics.MetricTypeNameCount)
return nil
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/agent/sysadvisor/plugin/qosaware/server/memory_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ func (ms *memoryServer) getAndPushAdvice(server advisorsvc.AdvisorService_ListAn
_ = ms.emitter.StoreInt64(ms.genMetricsName(metricServerLWSendResponseFailed), int64(ms.period.Seconds()), metrics.MetricTypeNameCount)
return fmt.Errorf("send listWatch response failed: %w", err)
}
klog.Infof("[qosaware-server-memory] sent listWatch resp: %v", general.ToString(lwResp))

if klog.V(6).Enabled() {
klog.Infof("[qosaware-server-memory] sent listWatch resp: %v", general.ToString(lwResp))
}

_ = ms.emitter.StoreInt64(ms.genMetricsName(metricServerLWSendResponseSucceeded), int64(ms.period.Seconds()), metrics.MetricTypeNameCount)
return nil
}
Expand Down

0 comments on commit 9a51efa

Please sign in to comment.