psutil 4.0.0 的新特性介绍

  1. 新增了进程内存真正使用信息

    psutil.Process().memory_full_info()
  2. 新增了进程环境变量功能

    >>> import psutil
    >>> from pprint import pprint as pp
    >>> pp(psutil.Process().environ())
    {...
     'CLUTTER_IM_MODULE': 'xim',
     'COLORTERM': 'gnome-terminal',
     'COMPIZ_BIN_PATH': '/usr/bin/',
     'HOME': '/home/giampaolo',
     'PWD': '/home/giampaolo/svn/psutil',
    }
    >>>
  3. 扩展了 disk IO 状态

    • busy_time, which is the time spent doing actual I/Os (in milliseconds).

    • read_merged_count and write_merged_count (Linux only), which is number of merged reads and writes (see iostats doc)

参考


yexiaobai
4.8k 声望875 粉丝

就是不告诉你 O(∩_∩)O哈哈~。