Did I find the right examples for you? yes no

All Samples(47)  |  Call(47)  |  Derive(0)  |  Import(0)
Return system-wide CPU times as a namedtuple.
Every CPU time represents the seconds the CPU has spent in the given mode.
The namedtuple's fields availability varies depending on the platform:
 - user
 - system
 - idle
 - nice (UNIX)
 - iowait (Linux)
 - irq (Linux, FreeBSD)
 - softirq (Linux)(more...)

        def cpu_times(percpu=False):
    """Return system-wide CPU times as a namedtuple.
    Every CPU time represents the seconds the CPU has spent in the given mode.
    The namedtuple's fields availability varies depending on the platform:
     - user
     - system
     - idle
     - nice (UNIX)
     - iowait (Linux)
     - irq (Linux, FreeBSD)
     - softirq (Linux)
     - steal (Linux >= 2.6.11)
     - guest (Linux >= 2.6.24)
     - guest_nice (Linux >= 3.2.0)

    When percpu is True return a list of nameduples for each CPU.
    First element of the list refers to first CPU, second element
    to second CPU and so on.
    The order of the list is consistent across calls.
    """
    if not percpu:
        return _psplatform.cpu_times()
    else:
        return _psplatform.per_cpu_times()
        


src/p/y/pyriemann-HEAD/examples/riemann_health.py   pyriemann(Download)
def cpu(warning=0.9, critical=0.95):
    c = psutil.cpu_times()
    used = c.user + c.system + c.nice
    total = used + c.idle
    f = used/total

src/h/t/HTPC-Manager-HEAD/modules/stats.py   HTPC-Manager(Download)
    def cpu_times(self):
        rr = None
        try:
            cpu = psutil.cpu_times(percpu=False)
            dcpu = cpu._asdict()

src/h/t/htopp-0.3/htopp/cmd.py   htopp(Download)
    def __init__(self, server, interval):
        threading.Thread.__init__(self)
        self.server = server
        self.cpu_times_history = psutil.cpu_times()
        self.interval = interval
    def run(self):
        while not self.terminated:
            val = psutil.cpu_percent(interval=self.interval, percpu=False) 
            cpu_times = psutil.cpu_times(percpu=True)
            try:
    def __init__(self, server, interval):
        threading.Thread.__init__(self)
        self.server = server
        self.per_cpu_times_history = psutil.cpu_times(percpu=True)
        self.interval = interval
    def run(self):
        while not self.terminated:
            result = []
            per_val = psutil.cpu_percent(interval=self.interval, percpu=True) 
            per_cpu_times = psutil.cpu_times(percpu=True)

src/d/r/droned-HEAD/droned/lib/droned/models/systemstats.py   droned(Download)
        '''
        if not self.PER_CPU and not self.CPUS:
            cputime = psutil.cpu_times()
            try: 
                func(cpu_str='ALL',cpu_int=-1,cpu_pct=self.cpu_percent,cpu_times=cputime)
                self.debug("")
        else:
            cputime = psutil.cpu_times(percpu=True)
            cpu_count = len(self.cpu_percent)
            for cpu in range(cpu_count):

src/g/l/Glances-1.7.6/glances/glances.py   Glances(Download)
        """
        # CPU
        cputime = psutil.cpu_times(percpu=False)
        cputime_total = cputime.user + cputime.system + cputime.idle
        # Only available on some OS
 
        # Per-CPU
        percputime = psutil.cpu_times(percpu=True)
        percputime_total = []
        for i in range(len(percputime)):

src/g/l/glances-HEAD/glances/glances.py   glances(Download)
        """
        # CPU
        cputime = psutil.cpu_times(percpu=False)
        cputime_total = cputime.user + cputime.system + cputime.idle
        # Only available on some OS
 
        # Per-CPU
        percputime = psutil.cpu_times(percpu=True)
        percputime_total = []
        for i in range(len(percputime)):

src/t/x/txStatsD-1.0.0/txstatsd/process.py   txStatsD(Download)
def report_system_stats(prefix="sys", percpu=False):
    cpu_times = psutil.cpu_times(percpu=percpu)
    system_stats = {}
    if not percpu:
        for mode, time in cpu_times._asdict().iteritems():

src/t/x/txstatsd-HEAD/txstatsd/process.py   txstatsd(Download)
def report_system_stats(prefix="sys", percpu=False):
    cpu_times = psutil.cpu_times(percpu=percpu)
    system_stats = {}
    if not percpu:
        for mode, time in cpu_times._asdict().iteritems():

src/s/a/salt-HEAD/salt/modules/ps.py   salt(Download)
    '''
    if per_cpu:
        result = [dict(times._asdict()) for times in psutil.cpu_times(True)]
    else:
        result = dict(psutil.cpu_times(per_cpu)._asdict())

src/s/a/salt-thin-HEAD/salt/modules/ps.py   salt-thin(Download)
    '''
    if per_cpu:
        result = [dict(times._asdict()) for times in psutil.cpu_times(True)]
    else:
        result = dict(psutil.cpu_times(per_cpu)._asdict())

  1 | 2 | 3  Next