Python2.7 psutil模块

   psutil is a module providing an interface for retrieving information on all running processes and system utilization (CPU, memory, disks, network, users) in a portable way by using Python

实验环境:ubuntu12.10 

psutil版本:0.6.1

包含类: 
    class AccessDenied(Error)  
    class Error(exceptions.Exception)
    class NoSuchProcess(Error)
    class Popen(Process)   
    class Process(__builtin__.object)
    class TimeoutExpired(Error)
 
方法:
    cpu_percent(interval=0.1, percpu=False)
     返回一个浮点数,表示整个系统CPU的利用率,百分比。
        
        When interval is > 0.0 compares system CPU times elapsed before
        and after the interval (blocking).
        
        When interval is 0.0 or None compares system CPU times elapsed
        since last call or module import, returning immediately.
        In this case is recommended for accuracy that this function be
        called with at least 0.1 seconds between calls.
        
        如果percpu为True,则返回每个cpu的利用率,百分比。
    
    cpu_times(percpu=False)
   返回系统cpu的运行时间,每个cpu的时间代表在给定的模式下每个cpu运行的时间
    disk_io_counters(perdisk=False)
   返回系统磁盘的I/O统计数据,如果为True,则返回每一个物理磁盘的统计数据。
    get_pid_list()
        返回一个PID的列表
    get_process_list(*args, **kwargs)
   返回一个所有运行的进程类的列表 
    network_io_counters(pernic=False)
   返回network的统计信息   
    pid_exists(pid)
        检测一个pid是否存在
    process_iter()
        Return a generator yielding a Process class instance for all
        running processes on the local machine.
        
        Every new Process instance is only created once and then cached
        into an internal table which is updated every time this is used.
        
        The sorting order in which processes are yielded is based on
        their PIDs.
    
    swap_memory()
   返回系统的swap统计信息    
    test()
        效果如同ps aux   
    virtual_memory()
   返回系统关于内存使用的统计信息

项目地址:https://code.google.com/p/psutil/

你可能感兴趣的:(python,psutil)