Please find the code segment as below:
public int getNumberOfInstancesRequiredBasedOnMemoryConsumption(float
threshold, double predictedValue,
int
max, int min) {
double numberOfAdditionalInstancesRequired = 0;
if(predictedValue != threshold) {
float scalingRange = 100 - threshold;
int instanceRange = max - min;
* if(instanceRange != 0){*
float gradient = scalingRange / instanceRange;
numberOfAdditionalInstancesRequired = (predictedValue -
threshold) / gradient;
}
}
return (int) Math.ceil(min + numberOfAdditionalInstancesRequired);
}
On Sun, Dec 21, 2014 at 1:18 PM, Reka Thirunavukkarasu <[email protected]>
wrote:
> Hi Lahiru,
>
> I saw the following code when calculating required instances. Since it is
> checking the instanceRange > 0, whenever the cluster instance reaches it
> maximum, this instanceRange is 0. At that point even though the load is
> high no decision is taken as the required instances is not getting
> calculated. Also, it is not notifying the parent as well even though it is
> max out.
>
> Shall we remove this check which will help to predict the required
> instances even when the max is reached. So that we can notify the parent
> about the max out.
>
> Thanks,
> Reka
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>
--
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007