GigaSpaces XAP 9.7.2 API

org.openspaces.grid.gsm.autoscaling
Class AutoScalingSlaUtils

java.lang.Object
  extended by org.openspaces.grid.gsm.autoscaling.AutoScalingSlaUtils

public class AutoScalingSlaUtils
extends Object

Author:
itaif

Constructor Summary
AutoScalingSlaUtils()
           
 
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
 

Constructor Detail

AutoScalingSlaUtils

public AutoScalingSlaUtils()
Method Detail

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 zones
maxPerZone - - the maximum capacity per zone
enforced - - the last enforced (allocated) capacity per zone
newPlanned - - the new (planned) capacity per zone (could be zero if no plan yet)
zones - - the zone for which the maximum capacity is requested
zoness - - 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 zones
minPerZone - - the minimum capacity per zone
enforced - - the last enforced (allocated) capacity per zone
newPlanned - - 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 requested
zoness - - 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)

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.