Skip to content

Commit 2ed4602

Browse files
committed
fix: added weighting to summation in order to consider a mix of partionable and non-partitionable devices
Signed-off-by: MenD32 <[email protected]>
1 parent c2633bf commit 2ed4602

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cluster-autoscaler/simulator/dynamicresources/utils/utilization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func calculatePoolUtil(unallocated, allocated []resourceapi.Device, resourceSlic
129129
var partitionableDevicesUtilizationWeight float64 = uniquePartitionableDevicesCount / totalUniqueDevices
130130
var nonPartitionableDevicesUtilizationWeight float64 = 1 - partitionableDevicesUtilizationWeight
131131
// when a pool has both atomic and partitionable devices, we sum their utilizations since they are mutually exclusive
132-
return partitionableUtilization * partitionableDevicesUtilizationWeight + atomicDevicesUtilization * nonPartitionableDevicesUtilizationWeight
132+
return partitionableUtilization*partitionableDevicesUtilizationWeight + atomicDevicesUtilization*nonPartitionableDevicesUtilizationWeight
133133
}
134134

135135
// calculateConsumedCounters calculates the total counters consumed by a list of devices

0 commit comments

Comments
 (0)