Package org.cloudsimplus.autoscaling
Class VerticalVmScalingSimple
java.lang.Object
org.cloudsimplus.autoscaling.VmScalingAbstract
org.cloudsimplus.autoscaling.VerticalVmScalingAbstract
org.cloudsimplus.autoscaling.VerticalVmScalingSimple
- All Implemented Interfaces:
VerticalVmScaling
,VmScaling
A
VerticalVmScaling
implementation which allows a DatacenterBroker
to perform on demand up or down scaling for some Vm
resource, such as Ram
,
Pe
or Bandwidth
.
For each resource that is required to be scaled, a distinct VerticalVmScaling
instance must be assigned to the VM to be scaled.
- Since:
- CloudSim Plus 1.1.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Fields inherited from interface org.cloudsimplus.autoscaling.VerticalVmScaling
NULL
-
Constructor Summary
ConstructorDescriptionVerticalVmScalingSimple
(Class<? extends ResourceManageable> resourceClassToScale, double scalingFactor) Creates a VerticalVmScalingSimple with aResourceScalingGradual
scaling type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the Vm is overloaded or not, based on theVerticalVmScaling.getUpperThresholdFunction()
.boolean
Checks if the Vm is underloaded or not, based on theVerticalVmScaling.getLowerThresholdFunction()
.Methods inherited from class org.cloudsimplus.autoscaling.VerticalVmScalingAbstract
allocateResourceForVm, getAllocatedResource, getLowerThresholdFunction, getResource, getResourceAmountToScale, getResourceClass, getResourceUsageThresholdFunction, getScalingFactor, getUpperThresholdFunction, isNotHostResourceAvailable, logResourceUnavailable, requestUpScaling, requestUpScalingIfPredicateMatches, setLowerThresholdFunction, setResourceScaling, setScalingFactor, setUpperThresholdFunction, setVm
Methods inherited from class org.cloudsimplus.autoscaling.VmScalingAbstract
getVm, isTimeToCheckPredicate, setLastProcessingTime
-
Constructor Details
-
VerticalVmScalingSimple
public VerticalVmScalingSimple(Class<? extends ResourceManageable> resourceClassToScale, double scalingFactor) Creates a VerticalVmScalingSimple with aResourceScalingGradual
scaling type.- Parameters:
resourceClassToScale
- the class of Vm resource that this scaling object will request up or down scaling (such asRam
.class,Bandwidth
.class orProcessor
.class).scalingFactor
- the factor (a percentage value in scale from 0 to 1) that will be used to scale a Vm resource up or down, whether such a resource is over or underloaded, according to the defined predicates. In the case of up scaling, the value 1 will scale the resource in 100%, doubling its capacity.- See Also:
-
-
Method Details
-
isVmUnderloaded
public boolean isVmUnderloaded()Description copied from interface:VerticalVmScaling
Checks if the Vm is underloaded or not, based on theVerticalVmScaling.getLowerThresholdFunction()
.- Returns:
- true if the Vm is underloaded, false otherwise
-
isVmOverloaded
public boolean isVmOverloaded()Description copied from interface:VerticalVmScaling
Checks if the Vm is overloaded or not, based on theVerticalVmScaling.getUpperThresholdFunction()
.- Returns:
- true if the Vm is overloaded, false otherwise
-