Skip to content

Commit 50c32ce

Browse files
committed
chore: improve session logging
Adding a log line about the session's total schedulable capacities. Recently there has been various changes in the session resource handlings, and it would be generally useful to have a log line about the cached resource, including TotalResource, TotalDeserved and TotalGuaranteed. Enhance capacity plugin queue attribute logs to include 'capability' for both flat and hierarchical queues and distinguishing the log line in the two cases. Signed-off-by: Hajnal Máté <[email protected]>
1 parent 2ea0f6f commit 50c32ce

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pkg/scheduler/framework/session.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ func openSession(cache cache.Cache) *Session {
225225
klog.V(3).Infof("Open Session %v with <%d> Job and <%d> Queues",
226226
ssn.UID, len(ssn.Jobs), len(ssn.Queues))
227227

228+
klog.V(4).Infof("Session %v is opened with TotalResource: <%s>, TotalDeserved: <%s>, TotalGuaranteed: <%s>",
229+
ssn.UID, ssn.TotalResource.String(), ssn.TotalDeserved.String(), ssn.TotalGuarantee.String())
230+
228231
return ssn
229232
}
230233

pkg/scheduler/plugins/capacity/capacity.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ func (cp *capacityPlugin) buildQueueAttrs(ssn *framework.Session) {
451451

452452
attr.deserved = helpers.Max(attr.deserved, attr.guarantee)
453453
cp.updateShare(attr)
454-
klog.V(4).Infof("The attributes of queue <%s> in capacity: deserved <%v>, realCapability <%v>, allocate <%v>, request <%v>, elastic <%v>, share <%0.2f>",
455-
attr.name, attr.deserved, attr.realCapability, attr.allocated, attr.request, attr.elastic, attr.share)
454+
klog.V(4).Infof("The attributes of queue <%s> in capacity: deserved <%v>, capability <%v>, realCapability <%v>, allocate <%v>, request <%v>, elastic <%v>, share <%0.2f>",
455+
attr.name, attr.deserved, attr.capability, attr.realCapability, attr.allocated, attr.request, attr.elastic, attr.share)
456456
}
457457

458458
// Record metrics
@@ -609,8 +609,8 @@ func (cp *capacityPlugin) buildHierarchicalQueueAttrs(ssn *framework.Session) bo
609609
// Update share
610610
for _, attr := range cp.queueOpts {
611611
cp.updateShare(attr)
612-
klog.V(4).Infof("The attributes of queue <%s> in capacity: deserved <%v>, realCapability <%v>, allocate <%v>, request <%v>, elastic <%v>, share <%0.2f>",
613-
attr.name, attr.deserved, attr.realCapability, attr.allocated, attr.request, attr.elastic, attr.share)
612+
klog.V(4).Infof("The attributes of hierarchical queue <%s> in capacity: deserved <%v>, capability <%v>, realCapability <%v>, allocate <%v>, request <%v>, elastic <%v>, share <%0.2f>",
613+
attr.name, attr.deserved, attr.capability, attr.realCapability, attr.allocated, attr.request, attr.elastic, attr.share)
614614
}
615615

616616
// Record metrics

0 commit comments

Comments
 (0)