summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-03-06 12:34:24 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2016-03-06 12:34:24 +0100
commit8563d432f795ebc7cbaadb926970e4063ced0642 (patch)
tree67b252f91be5ef0b065de02be522295652b2b36d
parent28e178a796cc5da990b23c09d69e37ed00f15a68 (diff)
downloadpsutil-8563d432f795ebc7cbaadb926970e4063ced0642.tar.gz
update doc [skip ci[
-rw-r--r--DEVGUIDE.rst2
-rw-r--r--README.rst6
-rw-r--r--docs/index.rst30
-rwxr-xr-xscripts/top.py4
4 files changed, 10 insertions, 32 deletions
diff --git a/DEVGUIDE.rst b/DEVGUIDE.rst
index 06595204..68074139 100644
--- a/DEVGUIDE.rst
+++ b/DEVGUIDE.rst
@@ -112,7 +112,7 @@ Test coverage
Test coverage is provided by `coveralls.io <https://coveralls.io/github/giampaolo/psutil>`_,
it is controlled via `.travis.yml <https://github.com/giampaolo/psutil/blob/master/.travis.yml>`_
-and it is update on every git push.
+and it is updated on every git push.
An icon in the home page (README) always shows the last coverage percentage:
.. image:: https://coveralls.io/repos/giampaolo/psutil/badge.svg?branch=master&service=github
diff --git a/README.rst b/README.rst
index 9b8bdcc2..eeef83c7 100644
--- a/README.rst
+++ b/README.rst
@@ -105,7 +105,6 @@ CPU
[7.0, 8.5, 2.4, 2.1]
[1.2, 9.0, 9.9, 7.2]
>>>
- >>>
>>> for x in range(3):
... psutil.cpu_times_percent(interval=1, percpu=False)
...
@@ -292,7 +291,8 @@ Process management
>>>
>>> p.environ()
{'LC_PAPER': 'it_IT.UTF-8', 'SHELL': '/bin/bash', 'GREP_OPTIONS': '--color=auto',
- 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'COLORTERM': 'gnome-terminal', ...}
+ 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'COLORTERM': 'gnome-terminal',
+ ...}
>>>
>>> p.suspend()
>>> p.resume()
@@ -329,7 +329,7 @@ Further process APIs
... print("process {} terminated".format(proc))
...
>>> # waits for multiple processes to terminate
- >>> gone, alive = psutil.wait_procs(procs_list, 3, callback=on_terminate)
+ >>> gone, alive = psutil.wait_procs(procs_list, timeout=3, callback=on_terminate)
>>>
======
diff --git a/docs/index.rst b/docs/index.rst
index 5d7e2a99..d236e64b 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -153,41 +153,19 @@ CPU
.. function:: cpu_stats()
Return various CPU statistics as a namedtuple whose fields change depending
- on the platform.
-
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | Linux | OSX | Windows | FreeBSD | OpenBSD | NetBSD | SunOS |
- +=================+=================+==============+=================+=================+=================+==============+
- | ctx_switches | ctx_switches | ctx_switches | ctx_switches | ctx_switches | ctx_switches | ctx_switches |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | interrupts | interrupts | interrupts | interrupts | interrupts | interrupts | interrupts |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | soft_interrupts | soft_interrupts | dpcs | soft_interrupts | soft_interrupts | soft_interrupts | syscalls |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | | syscalls | syscalls | syscalls | syscalls | syscalls | traps |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | | traps | | traps | traps | traps | |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | | | | | | | |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | | | | | | | |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
- | | | | | | | |
- +-----------------+-----------------+--------------+-----------------+-----------------+-----------------+--------------+
+ on the platform:
- **ctx_switches**:
number of context switches (voluntary + involuntary) since boot.
- **interrupts**:
number of interrupts since boot.
- - **soft_interrupts**:
+ - **soft_interrupts** *(POSIX)*:
number of software interrupts since boot.
- - **syscalls**: number of system calls since boot.
- - **traps**: number of kernel traps since boot.
+ - **syscalls** *(all platforms except Linux)*: number of system calls since boot.
+ - **traps** *(BSD, OSX, SunOS)*: number of kernel traps since boot.
- **dpcs** *(Windows)*: number of
`delayed procedure calls <https://technet.microsoft.com/en-us/library/cc938646.aspx>`__
since boot.
- - **procs_running** *(Linux)*: current number of actively running processes.
- - **procs_blocked** *(Linux)*: current number of processes waiting for I/O.
Example (Linux):
diff --git a/scripts/top.py b/scripts/top.py
index e172a306..91c32e24 100755
--- a/scripts/top.py
+++ b/scripts/top.py
@@ -16,7 +16,7 @@ $ python scripts/top.py
CPU3 [||||| ] 13.9%
Mem [||||||||||||||||||| ] 49.8% 4920M/9888M
Swap [ ] 0.0% 0M/0M
- Processes: 287 (running=1 sleeping=286)
+ Processes: 287 (running=1, sleeping=286, zombie=1)
Load average: 0.34 0.54 0.46 Uptime: 3 days, 10:16:37
PID USER NI VIRT RES CPU% MEM% TIME+ NAME
@@ -164,7 +164,7 @@ def print_header(procs_status, num_procs):
if y:
st.append("%s=%s" % (x, y))
st.sort(key=lambda x: x[:3] in ('run', 'sle'), reverse=1)
- print_line(" Processes: %s (%s)" % (num_procs, ' '.join(st)))
+ 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()