diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-09-23 15:22:13 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-09-23 15:22:13 +0200 |
commit | f8778459744d30d3589728f40e8c9a9417ba1c93 (patch) | |
tree | d9a3f1c9f1f94aa8ad238c004060fa5bc1b4cb8c | |
parent | 2f7d50db44246826814a81ec55e991b61b774215 (diff) | |
download | psutil-f8778459744d30d3589728f40e8c9a9417ba1c93.tar.gz |
update doc
-rw-r--r-- | docs/index.rst | 25 | ||||
-rwxr-xr-x | scripts/ifconfig.py | 48 |
2 files changed, 47 insertions, 26 deletions
diff --git a/docs/index.rst b/docs/index.rst index 534233ee..0e412ddc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -202,7 +202,7 @@ Memory The sum of **used** and **available** does not necessarily equal **total**. On Windows **available** and **free** are the same. - See `scripts/meminfo.py <https://github.com/giampaolo/psutil/blob/master/scripts/meminfo.py>`__ + See `meminfo.py <https://github.com/giampaolo/psutil/blob/master/scripts/meminfo.py>`__ script providing an example on how to convert bytes in a human readable form. .. note:: if you just want to know how much physical memory is left in a @@ -240,7 +240,7 @@ Memory (cumulative) **sin** and **sout** on Windows are always set to ``0``. - See `scripts/meminfo.py <https://github.com/giampaolo/psutil/blob/master/scripts/meminfo.py>`__ + See `meminfo.py <https://github.com/giampaolo/psutil/blob/master/scripts/meminfo.py>`__ script providing an example on how to convert bytes in a human readable form. >>> import psutil @@ -329,7 +329,7 @@ Disks If *perdisk* is ``True`` return the same information for every physical disk installed on the system as a dictionary with partition names as the keys and the namedtuple described above as the values. - See `scripts/iotop.py <https://github.com/giampaolo/psutil/blob/master/scripts/iotop.py>`__ + See `iotop.py <https://github.com/giampaolo/psutil/blob/master/scripts/iotop.py>`__ for an example application. >>> import psutil @@ -375,8 +375,6 @@ Network If *pernic* is ``True`` return the same information for every network interface installed on the system as a dictionary with network interface names as the keys and the namedtuple described above as the values. - See `scripts/nettop.py <https://github.com/giampaolo/psutil/blob/master/scripts/nettop.py>`__ - for an example application. >>> import psutil >>> psutil.net_io_counters() @@ -386,6 +384,10 @@ Network {'lo': snetio(bytes_sent=547971, bytes_recv=547971, packets_sent=5075, packets_recv=5075, errin=0, errout=0, dropin=0, dropout=0), 'wlan0': snetio(bytes_sent=13921765, bytes_recv=62162574, packets_sent=79097, packets_recv=89648, errin=0, errout=0, dropin=0, dropout=0)} + Also see `nettop.py <https://github.com/giampaolo/psutil/blob/master/scripts/nettop.py>`__ + and `ifconfig.py <https://github.com/giampaolo/psutil/blob/master/scripts/ifconfig.py>`__ + for an example application. + .. warning:: on some systems such as Linux, on a very busy or long-lived system these numbers may wrap (restart from zero), see @@ -516,7 +518,8 @@ Network snic(family=<AddressFamily.AF_LINK: 17>, address='c4:85:08:45:06:41', netmask=None, broadcast='ff:ff:ff:ff:ff:ff', ptp=None)]} >>> - See also `scripts/ifconfig.py <https://github.com/giampaolo/psutil/blob/master/scripts/ifconfig.py>`__ + See also `nettop.py <https://github.com/giampaolo/psutil/blob/master/scripts/nettop.py>`__ + and `ifconfig.py <https://github.com/giampaolo/psutil/blob/master/scripts/ifconfig.py>`__ for an example application. .. note:: @@ -552,8 +555,6 @@ Network determined (e.g. 'localhost') it will be set to ``0``. - **mtu**: NIC's maximum transmission unit expressed in bytes. - See also `scripts/ifconfig.py <https://github.com/giampaolo/psutil/blob/master/scripts/ifconfig.py>`__ - for an example application. Example: >>> import psutil @@ -561,6 +562,10 @@ Network {'eth0': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_FULL: 2>, speed=100, mtu=1500), 'lo': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_UNKNOWN: 0>, speed=0, mtu=65536)} + Also see `nettop.py <https://github.com/giampaolo/psutil/blob/master/scripts/nettop.py>`__ + and `ifconfig.py <https://github.com/giampaolo/psutil/blob/master/scripts/ifconfig.py>`__ + for an example application. + .. versionadded:: 3.0.0 @@ -1202,7 +1207,7 @@ Process class pfullmem(rss=10199040, vms=52133888, shared=3887104, text=2867200, lib=0, data=5967872, dirty=0, uss=6545408, pss=6872064, swap=0) >>> - See also `scripts/procsmem.py <https://github.com/giampaolo/psutil/blob/master/scripts/procsmem.py>`__ + See also `procsmem.py <https://github.com/giampaolo/psutil/blob/master/scripts/procsmem.py>`__ for an example application. .. versionadded:: 4.0.0 @@ -1231,7 +1236,7 @@ Process class is ``False`` each mapped region is shown as a single entity and the namedtuple will also include the mapped region's address space (*addr*) and permission set (*perms*). - See `scripts/pmap.py <https://github.com/giampaolo/psutil/blob/master/scripts/pmap.py>`__ + See `pmap.py <https://github.com/giampaolo/psutil/blob/master/scripts/pmap.py>`__ for an example application. +---------------+--------------+---------+-----------+--------------+ diff --git a/scripts/ifconfig.py b/scripts/ifconfig.py index 9025a23b..fa17152b 100755 --- a/scripts/ifconfig.py +++ b/scripts/ifconfig.py @@ -8,23 +8,39 @@ A clone of 'ifconfig' on UNIX. $ python scripts/ifconfig.py -lo (speed=0MB, duplex=?, mtu=65536, up=yes): - IPv4 address : 127.0.0.1 - broadcast : 127.0.0.1 - netmask : 255.0.0.0 - IPv6 address : ::1 - netmask : ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff - MAC address : 00:00:00:00:00:00 - broadcast : 00:00:00:00:00:00 +lo: + stats : speed=0MB, duplex=?, mtu=65536, up=yes + incoming : bytes=6874907, pkts=83869, errs=0, drops=0 + outgoing : bytes=6874907, pkts=83869, errs=0, drops=0 + IPv4 address : 127.0.0.1 + netmask : 255.0.0.0 + IPv6 address : ::1 + netmask : ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + MAC address : 00:00:00:00:00:00 -eth0 (speed=100MB, duplex=full, mtu=1500, up=yes): - IPv4 address : 192.168.1.2 - broadcast : 192.168.1.255 - netmask : 255.255.255.0 - IPv6 address : fe80::c685:8ff:fe45:641 - netmask : ffff:ffff:ffff:ffff:: - MAC address : c4:85:08:45:06:41 - broadcast : ff:ff:ff:ff:ff:ff +vboxnet0: + stats : speed=10MB, duplex=full, mtu=1500, up=yes + incoming : bytes=0, pkts=0, errs=0, drops=0 + outgoing : bytes=1617630, pkts=9078, errs=0, drops=0 + IPv4 address : 192.168.33.1 + broadcast : 192.168.33.255 + netmask : 255.255.255.0 + IPv6 address : fe80::800:27ff:fe00:0%vboxnet0 + netmask : ffff:ffff:ffff:ffff:: + MAC address : 0a:00:27:00:00:00 + broadcast : ff:ff:ff:ff:ff:ff + +eth0: + stats : speed=0MB, duplex=?, mtu=1500, up=yes + incoming : bytes=18903492448, pkts=15165269, errs=0, drops=21 + outgoing : bytes=1903956853, pkts=9528495, errs=0, drops=0 + IPv4 address : 10.0.0.3 + broadcast : 10.255.255.255 + netmask : 255.0.0.0 + IPv6 address : fe80::7592:1dcf:bcb7:98d6%wlp3s0 + netmask : ffff:ffff:ffff:ffff:: + MAC address : 48:45:20:59:a4:0c + broadcast : ff:ff:ff:ff:ff:ff """ from __future__ import print_function |