@rbac('*')
    def time_estimate(self, resource_desc):
        retcode, info = self.check_compatibility(resource_desc)
        if retcode != 0:
            return (retcode, info)

        # Check system load.
        try:
            loadavgs = os.getloadavg()
        # Not available on Windows.
        except AttributeError:  #pragma no cover
            criteria = {
                'hostnames'  : [socket.gethostname()],
                'total_cpus' : self.total_cpus,
            }
            return (0, criteria)

        self._logger.debug('loadavgs %.2f, %.2f, %.2f, max_load %.2f',
                           loadavgs[0], loadavgs[1], loadavgs[2],
                           self.max_load * self.total_cpus)
        criteria = {
            'hostnames'  : [socket.gethostname()],
            'loadavgs'   : loadavgs,
            'total_cpus' : self.total_cpus,
            'max_load'   : self.max_load
        }
        if (loadavgs[0] / self.total_cpus) < self.max_load:
            return (0, criteria)
        elif len(self._deployed_servers) == 0:
            # Ensure progress by always allowing 1 server.
            return (0, criteria)
        # Tests force max_load high to avoid other issues.
        else:  #pragma no cover
            return (-1, criteria)  # Try again later.
Returns the URL the request e.g. 'http://localhost:8080/foo?bar=baz'.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/resource.py/LocalAllocator.time_estimate--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/request_info.py/RequestInfo.get_request_url