@@ -518,6 +518,8 @@ private Pair<List<Long>, Map<Long, Double>> getOrderedPodsByCapacity(long zoneId
518518 double cpuToMemoryWeight = ConfigurationManager .HostCapacityTypeCpuMemoryWeight .value ();
519519 short capacityType = getHostCapacityTypeToOrderCluster (
520520 configDao .getValue (Config .HostCapacityTypeToOrderClusters .key ()), cpuToMemoryWeight );
521+
522+ logger .debug ("CapacityType: {} is used for Pod ordering" , getCapacityTypeName (capacityType ));
521523 if (capacityType >= 0 ) { // for capacityType other than COMBINED
522524 return capacityDao .orderPodsByAggregateCapacity (zoneId , capacityType );
523525 }
@@ -551,6 +553,8 @@ private Pair<List<Long>, Map<Long, Double>> getOrderedClustersByCapacity(long id
551553 double cpuToMemoryWeight = ConfigurationManager .HostCapacityTypeCpuMemoryWeight .value ();
552554 short capacityType = getHostCapacityTypeToOrderCluster (
553555 configDao .getValue (Config .HostCapacityTypeToOrderClusters .key ()), cpuToMemoryWeight );
556+
557+ logger .debug ("CapacityType: {} is used for Cluster ordering" , getCapacityTypeName (capacityType ));
554558 if (capacityType >= 0 ) { // for capacityType other than COMBINED
555559 return capacityDao .orderClustersByAggregateCapacity (id , vmId , capacityType , isZone );
556560 }
@@ -564,6 +568,15 @@ private Pair<List<Long>, Map<Long, Double>> getOrderedClustersByCapacity(long id
564568 return new Pair <>(new ArrayList <>(clusterByCombinedCapacities .keySet ()), clusterByCombinedCapacities );
565569 }
566570
571+ public static String getCapacityTypeName (short capacityType ) {
572+ switch (capacityType ) {
573+ case 0 : return ApiConstants .RAM ;
574+ case 1 : return ApiConstants .CPU ;
575+ case -1 : return ApiConstants .COMBINED_CAPACITY_ORDERING ;
576+ default : return "UNKNOWN" ;
577+ }
578+ }
579+
567580 public Map <Long , Double > getClusterByCombinedCapacities (List <CapacityVO > capacities , double cpuToMemoryWeight ) {
568581 Map <Long , Double > clusterByCombinedCapacity = new HashMap <>();
569582 for (CapacityVO capacityVO : capacities ) {
0 commit comments