Source:
<code>public static boolean isValidInstance(Resource instanceResources, long minInstanceRam, Resource maxContainerResources, int paddingPercentage) { if (instanceResources.getRam() < minInstanceRam) { LOG.severe(String.format( "Instance requires %d MB ram which is less than the minimum %d MB ram per instance", instanceResources.getRam(), minInstanceRam / Constants.MB)); return false; } if (instanceResources.getRam() + (paddingPercentage * instanceResources.getRam()) / 100 > maxContainerResources.getRam()) { LOG.severe(String.format( "This instance requires containers of at least %d MB ram. The current max container" + "size is %d MB", <START> instanceResources.getRam() + (paddingPercentage * instanceResources.getRam()) / 100, <END> maxContainerResources.getRam())); return false; } if (Math.round(instanceResources.getCpu() + (paddingPercentage * instanceResources.getCpu()) / 100) > maxContainerResources.getCpu()) { LOG.severe(String.format( "This instance requires containers with at least %s cpu cores. The current max container" + "size is %s cores", Math.round(instanceResources.getCpu() + (paddingPercentage * instanceResources.getCpu()) / 100) > maxContainerResources.getCpu(), maxContainerResources.getCpu())); return false; } if (instanceResources.getDisk() + (paddingPercentage * instanceResources.getDisk()) / 100 > maxContainerResources.getDisk()) { LOG.severe(String.format( "This instance requires containers of at least %d MB disk. The current max container" + "size is %d MB", instanceResources.getDisk() + (paddingPercentage * instanceResources.getDisk() / 100), maxContainerResources.getDisk())); return false; } return true; }</code><technical_language>calculate pad in criteria logging. for below</technical_language>

Target:
public static boolean isValidInstance(Resource instanceResources, long minInstanceRam, Resource maxContainerResources, int paddingPercentage) { if (instanceResources.getRam() < minInstanceRam) { LOG.severe(String.format( "Instance requires %d MB ram which is less than the minimum %d MB ram per instance", instanceResources.getRam(), minInstanceRam / Constants.MB)); return false; } long instanceRam = PackingUtils.increaseBy(instanceResources.getRam(), paddingPercentage); if (instanceRam > maxContainerResources.getRam()) { LOG.severe(String.format( "This instance requires containers of at least %d MB ram. The current max container" + "size is %d MB", instanceRam, maxContainerResources.getRam())); return false; } double instanceCpu = Math.round(PackingUtils.increaseBy( instanceResources.getCpu(), paddingPercentage)); if (instanceCpu > maxContainerResources.getCpu()) { LOG.severe(String.format( "This instance requires containers with at least %s cpu cores. The current max container" + "size is %s cores", instanceCpu > maxContainerResources.getCpu(), maxContainerResources.getCpu())); return false; } long instanceDisk = PackingUtils.increaseBy(instanceResources.getDisk(), paddingPercentage); if (instanceDisk > maxContainerResources.getDisk()) { LOG.severe(String.format( "This instance requires containers of at least %d MB disk. The current max container" + "size is %d MB", instanceDisk, maxContainerResources.getDisk())); return false; } return true; }