All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.common.SystemUtils Maven / Gradle / Ivy

The newest version!
/*Server class MD5: e6d3160dca0bd40e82a4586ab0622e23*/
package com.jelastic.api.common;

/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public class SystemUtils {

    public static int getCloudletsCountByMemory(long mem, long memPerCloudlet) {
        return (int) Math.ceil(mem / (double) memPerCloudlet);
    }

    public static int getCloudletsCountByCPU(int cpuMHz, long cpuPerCloudlet) {
        return (int) Math.ceil(cpuMHz / (double) cpuPerCloudlet);
    }

    public static int getCapacityCount(long disk) {
        return (int) Math.ceil(disk / (double) Constants.DISK_MEGABYTE_PER_CAPACITY);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy