4
A collection of ideas and notes about stuff to implement in future versions.
5
"#NNN" occurrences refer to bug tracker issues at:
6
https://github.com/giampaolo/psutil/issues
11
- (UNIX) process root (different from cwd)
13
- (Linux) locked files via /proc/locks:
14
https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-proc-locks.html
16
- #269: NIC rx/tx queue. This should probably go into net_if_stats().
17
Figure out on what platforms this is supported:
21
- Asynchronous psutil.Popen (see http://bugs.python.org/issue1191964)
23
- (Windows) fall back on using WMIC for Process methods returning AccessDenied
25
- #613: thread names; patch for macOS available at:
26
https://code.google.com/p/plcrashreporter/issues/detail?id=65
28
https://github.com/janmojzis/pstree/blob/master/proc_kvm.c
30
- scripts/taskmgr-gui.py (using tk).
32
- system-wide number of open file descriptors:
33
- https://jira.hyperic.com/browse/SIGAR-30
35
- Number of system threads.
36
- Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684824(v=vs.85).aspx
38
- Doc / wiki which compares similarities between UNIX cli tools and psutil.
41
df -a -> psutil.disk_partitions
42
lsof -> psutil.Process.open_files() and psutil.Process.net_connections()
43
killall-> (actual script)
44
tty -> psutil.Process.terminal()
48
- psutil.proc_tree() something which obtains a {pid:ppid, ...} dict for
49
all running processes in one shot. This can be factored out from
50
Process.children() and exposed as a first class function.
51
PROS: on Windows we can take advantage of _psutil_windows.ppid_map()
52
which is faster than iterating over all pids and calling ppid().
53
CONS: scripts/pstree.py shows this can be easily done in the user code
54
so maybe it's not worth the addition.
56
- advanced cmdline interface exposing the whole API and providing different
57
kind of outputs (e.g. pprinted, colorized, json).
59
- [Linux]: process cgroups (http://en.wikipedia.org/wiki/Cgroups). They look
60
similar to prlimit() in terms of functionality but uglier (they should allow
61
limiting per-process network IO resources though, which is great). Needs
64
- Python 3.3. exposed different sched.h functions:
65
http://docs.python.org/dev/whatsnew/3.3.html#os
66
http://bugs.python.org/issue12655
67
http://docs.python.org/dev/library/os.html#interface-to-the-scheduler
68
It might be worth to take a look and figure out whether we can include some
70
Also, we can probably reimplement wait_pid() on POSIX which is currently
71
implemented as a busy-loop.
73
- os.times() provides 'elapsed' times (cpu_times() might).
75
- ...also guest_time and cguest_time on Linux.
77
- Enrich exception classes hierarchy on Python >= 3.3 / post PEP-3151 so that:
78
- NoSuchProcess inherits from ProcessLookupError
79
- AccessDenied inherits from PermissionError
80
- TimeoutExpired inherits from TimeoutError (debatable)
81
See: http://docs.python.org/3/library/exceptions.html#os-exceptions
83
- Process.threads() might grow an extra "id" parameter so that it can be
86
>>> p = psutil.Process(os.getpid())
87
>>> p.threads(id=psutil.current_thread_id())
88
thread(id=2539, user_time=0.03, system_time=0.02)
91
Note: this leads to questions such as "should we have a custom NoSuchThread
92
exception? Also see issue #418.
93
Note #2: this would work with os.getpid() only.
94
psutil.current_thread_id() might be desirable as per issue #418 though.
96
- should psutil.TimeoutExpired exception have a 'msg' kwarg similar to
97
NoSuchProcess and AccessDenied? Not that we need it, but currently we
98
cannot raise a TimeoutExpired exception with a specific error string.
100
- round Process.memory_percent() result?
105
- #600: windows / open_files(): support network file handles.
110
- #550: threads per core
111
- #1667: process_iter(new_only=True)
116
- PROCFS_PATH should have been set_procfs_path().
117
- `virtual_memory()` should have been `memory_virtual()`.
118
- `swap_memory()` should have been `memory_swap()`.
123
- conky: https://github.com/brndnmtthws/conky/
124
- sigar: https://github.com/hyperic/sigar (Java)
125
- zabbix: https://zabbix.org/wiki/Get_Zabbix
126
- libstatgrab: http://www.i-scream.org/libstatgrab/
127
- top: http://www.unixtop.org/
128
- oshi: https://github.com/oshi/oshi
129
- netdata: https://github.com/netdata/netdata