class OSUtils {

    public static Boolean checkResource(double systemCpuLoad, double systemReservedMemory) {
        // system load average
        double loadAverage = OSUtils.loadAverage();
        // system available physical memory
        double availablePhysicalMemorySize = OSUtils.availablePhysicalMemorySize();

        if (loadAverage > systemCpuLoad || availablePhysicalMemorySize < systemReservedMemory) {
            logger.warn("load is too high or availablePhysicalMemorySize(G) is too low, it's availablePhysicalMemorySize(G):{},loadAvg:{}", availablePhysicalMemorySize, loadAverage);
            return false;
        } else {
            return true;
        }
    }

    private  OSUtils();

}