org.openspaces.grid.gsm.autoscaling
Class AutoScalingSlaUtils
java.lang.Object
org.openspaces.grid.gsm.autoscaling.AutoScalingSlaUtils
public class AutoScalingSlaUtils
- extends Object
- Author:
- itaif
Method Summary |
static int |
compare(Comparable<?> threshold,
Object value)
|
static String |
formatMetricValue(Object value)
|
static CapacityRequirements |
getMaximumCapacity(CapacityRequirements totalMax,
CapacityRequirements maxPerZone,
CapacityRequirementsPerZones enforced,
CapacityRequirementsPerZones newPlanned,
ZonesConfig zones)
Calculates the maximum capacity for the specified zones. |
static CapacityRequirements |
getMinimumCapacity(CapacityRequirements totalMin,
CapacityRequirements minPerZone,
CapacityRequirementsPerZones enforced,
CapacityRequirementsPerZones newPlanned,
ZonesConfig zones)
Calculates the minimum capacity for the specified zones. |
static Object |
getStatisticsValue(ProcessingUnit pu,
Map<ProcessingUnitStatisticsId,Object> statistics,
ProcessingUnitStatisticsId ruleStatisticsId)
Validates that the specified statisticsId defined in the rule |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AutoScalingSlaUtils
public AutoScalingSlaUtils()
compare
public static int compare(Comparable<?> threshold,
Object value)
throws NumberFormatException
- Throws:
NumberFormatException
getMaximumCapacity
public static CapacityRequirements getMaximumCapacity(CapacityRequirements totalMax,
CapacityRequirements maxPerZone,
CapacityRequirementsPerZones enforced,
CapacityRequirementsPerZones newPlanned,
ZonesConfig zones)
- Calculates the maximum capacity for the specified zones.
The algorithm tries to be very conservative and may return a smaller value than maxPerZones.
otherCapacity = sum (foreach otherZones!=zones --> min(maxPerZone,max(last[otherZones],newPlanned[otherZones]))
return min(maxPerZones, totalMax - otherCapacity)
- Parameters:
totalMax
- - the maximum capacity when adding up all zonesmaxPerZone
- - the maximum capacity per zoneenforced
- - the last enforced (allocated) capacity per zonenewPlanned
- - the new (planned) capacity per zone (could be zero if no plan yet)zones
- - the zone for which the maximum capacity is requestedzoness
- - the complete list of zones
getMinimumCapacity
public static CapacityRequirements getMinimumCapacity(CapacityRequirements totalMin,
CapacityRequirements minPerZone,
CapacityRequirementsPerZones enforced,
CapacityRequirementsPerZones newPlanned,
ZonesConfig zones)
- Calculates the minimum capacity for the specified zones.
The algorithm tries to be very conservative and may return a bigger value than minPerZones.
otherCapacity = sum (foreach otherZones!=zones --> max(minPerZone,min(last[otherZones], newPlanned[otherZones]))
return min(maxPerZones, totalMin - otherCapacity)
- Parameters:
totalMin
- - the minimum capacity when adding up all zonesminPerZone
- - the minimum capacity per zoneenforced
- - the last enforced (allocated) capacity per zonenewPlanned
- - the new (planned) capacity per zone (could be zero if no plan yet, in that case it is ignored)zones
- - the zone for which the maximum capacity is requestedzoness
- - the complete list of zones
getStatisticsValue
public static Object getStatisticsValue(ProcessingUnit pu,
Map<ProcessingUnitStatisticsId,Object> statistics,
ProcessingUnitStatisticsId ruleStatisticsId)
throws AutoScalingSlaEnforcementInProgressException
- Validates that the specified statisticsId defined in the rule
- Throws:
AutoScalingSlaEnforcementInProgressException
formatMetricValue
public static String formatMetricValue(Object value)
Copyright © GigaSpaces.