Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
float(x) -> floating point number

Convert a string or number to a floating point number, if possible.

src/p/s/psutil-HEAD/examples/top.py   psutil(Download)
    print_line(" Processes: %s (%s)" % (num_procs, ' '.join(st)))
    # load average, uptime
    uptime = datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)
    av1, av2, av3 = os.getloadavg()
    line = " Load average: %.2f %.2f %.2f  Uptime: %s" \

src/p/c/pcd8544-HEAD/examples/sys_info.py   pcd8544(Download)
def cpu_usage():
    # load average, uptime
    uptime = datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)
    av1, av2, av3 = os.getloadavg()
    return "Load:%.1f %.1f %.1f Up: %s" \

src/n/e/newRHELic-HEAD/newrelic.py   newRHELic(Download)
    def _get_boottime(self):
        try:
            '''a quick function to make uptime human-readable'''
            a = time.gmtime(psutil.BOOT_TIME)
            boottime = "%s-%s-%s %s:%s:%s" % (a.tm_mon, a.tm_mday, a.tm_year, a.tm_hour, a.tm_min, a.tm_sec)

src/g/l/Glances-1.7.6/glances/glances.py   Glances(Download)
                        getattr(psutil, 'boot_time'))()
        except AttributeError:
            boot_time = psutil.BOOT_TIME
        self.uptime = datetime.now() - datetime.fromtimestamp(boot_time)
        # Convert uptime to string (because datetime is not JSONifi)

src/g/l/glances-HEAD/glances/glances.py   glances(Download)
                        getattr(psutil, 'boot_time'))()
        except AttributeError:
            boot_time = psutil.BOOT_TIME
        self.uptime = datetime.now() - datetime.fromtimestamp(boot_time)
        # Convert uptime to string (because datetime is not JSONifi)

src/s/a/salt-2014.1.3/salt/modules/ps.py   salt(Download)
        salt '*' ps.boot_time
    '''
    return psutil.BOOT_TIME
 
 

src/m/m/mmc-HEAD/core/agent/mmc/plugins/dashboard/panel.py   mmc(Download)
            'dist': dist,
            'load': [str(val) for val in os.getloadavg()],
            'uptime': str(datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)),
            'users': len(getUsersLdap()),
            'memory': {

src/g/r/grr-HEAD/client/client_actions/admin.py   grr(Download)
            "grr_client_sent_bytes"),
        create_time=long(proc.create_time * 1e6),
        boot_time=long(psutil.BOOT_TIME * 1e6))
 
    samples = self.grr_worker.stats_collector.cpu_samples
 
    response = rdfvalue.StartupInfo(
        boot_time=long(psutil.BOOT_TIME * 1e6),
        client_info=GetClientInformation())
 

src/h/t/htopp-0.3/htopp/cmd.py   htopp(Download)
    def uptime(self):
        return str(datetime.datetime.now() - datetime.datetime.fromtimestamp(psutil.BOOT_TIME))[:-7]
 
    def cnt_process(self, filtered=all):
        return len(list(filter(filtered, self.info['process'])))

src/p/o/powerline-status-0.0.1/powerline/segments/common.py   powerline-status(Download)
	def _get_uptime():  # NOQA
		# psutil.BOOT_TIME is not subject to clock adjustments, but time() is. 
		# Thus it is a fallback to /proc/uptime reading and not the reverse.
		return int(time() - psutil.BOOT_TIME)
else:

  1 | 2  Next