diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-02-27 11:09:23 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-02-27 11:09:23 +0100 |
commit | 70cab375dfb07450c8bd266a0d181f81f49ad25f (patch) | |
tree | d04f99af4094de5656a61a51117d51562999c0d2 | |
parent | 7d417f0109201d149f019323f48ed1898a6e9e00 (diff) | |
download | psutil-70cab375dfb07450c8bd266a0d181f81f49ad25f.tar.gz |
update IDEAS syntax + try to execute coverage on linux onlu
-rwxr-xr-x | .ci/travis/run.sh | 8 | ||||
-rw-r--r-- | IDEAS | 206 |
2 files changed, 110 insertions, 104 deletions
diff --git a/.ci/travis/run.sh b/.ci/travis/run.sh index 9bb62cbf..4269f30c 100755 --- a/.ci/travis/run.sh +++ b/.ci/travis/run.sh @@ -12,7 +12,13 @@ fi python setup.py build python setup.py develop -coverage run psutil/tests/runner.py --include="psutil/*" --omit="test/*,*setup*" + +if [[ "$(uname -s)" != 'Darwin' ]]; then + coverage run psutil/tests/runner.py --include="psutil/*" --omit="test/*,*setup*" +else + python psutil/tests/runner.py +fi + python psutil/tests/test_memory_leaks.py flake8 pep8 @@ -5,139 +5,139 @@ A collection of ideas and notes about stuff to implement in future versions. "#NNN" occurrences refer to bug tracker issues at: https://github.com/giampaolo/psutil/issues - PLATFORMS ========= - * #355 (patch): Android - - * #605 (branch): AIX - - * #276: GNU/Hurd - - * DragonFlyBSD - - * HP-UX - +- #355 (patch): Android +- #605 (branch): AIX +- #276: GNU/Hurd +- DragonFlyBSD +- HP-UX FEATURES ======== - * #371: CPU temperature (apparently OSX and Linux only; on Linux it requires - lm-sensors lib). +- (UNIX) process root (different from xwd) + +- (Linux) locked files via /proc/locks: + https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-proc-locks.html + +- #371: CPU temperature (apparently OSX and Linux only; on Linux it requires + lm-sensors lib). - * #269: NIC rx/tx queue. This should probably go into net_if_stats(). - Figure out on what platforms this is supported: - Linux: yes - Others: ? +- #269: NIC rx/tx queue. This should probably go into net_if_stats(). + Figure out on what platforms this is supported: + Linux: yes + Others: ? - * Process.threads(): thread names; patch for OSX available at: - https://code.google.com/p/plcrashreporter/issues/detail?id=65 - Sample code: - https://github.com/janmojzis/pstree/blob/master/proc_kvm.c +- Process.threads(): thread names; patch for OSX available at: + https://code.google.com/p/plcrashreporter/issues/detail?id=65 + Sample code: + https://github.com/janmojzis/pstree/blob/master/proc_kvm.c - * Asynchronous psutil.Popen (see http://bugs.python.org/issue1191964) +- Asynchronous psutil.Popen (see http://bugs.python.org/issue1191964) - * (Windows) fall back on using WMIC for Process methods returning AccessDenied +- (Windows) fall back on using WMIC for Process methods returning AccessDenied - * #613: thread names. +- #613: thread names. - * #604: emulate os.getloadavg() on Windows +- #604: emulate os.getloadavg() on Windows - * (Linux) extend Process.open_files() in order to read from /proc/pid/fdinfo - and return file position and flags/mode. +- (Linux) extend Process.open_files() in order to read from /proc/pid/fdinfo + and return file position and flags/mode. - * scripts/taskmgr-gui.py (using tk). +- scripts/taskmgr-gui.py (using tk). - * system-wide number of open file descriptors: - * https://jira.hyperic.com/browse/SIGAR-30 - * http://www.netadmintools.com/part295.html +- system-wide number of open file descriptors: + - https://jira.hyperic.com/browse/SIGAR-30 + - http://www.netadmintools.com/part295.html - * Number of system threads. - * Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684824(v=vs.85).aspx +- Number of system threads. + - Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684824(v=vs.85).aspx - * #357: what CPU a process is on. +- #357: what CPU a process is on. - * Doc / wiki which compares similarities between UNIX cli tools and psutil. - Example: - df -a -> psutil.disk_partitions - lsof -> psutil.Process.open_files() and psutil.Process.open_connections() - killall-> (actual script) - tty -> psutil.Process.terminal() - who -> psutil.users() +- Doc / wiki which compares similarities between UNIX cli tools and psutil. + Example: + ``` + df -a -> psutil.disk_partitions + lsof -> psutil.Process.open_files() and psutil.Process.open_connections() + killall-> (actual script) + tty -> psutil.Process.terminal() + who -> psutil.users() + ``` - * psutil.proc_tree() something which obtains a {pid:ppid, ...} dict for - all running processes in one shot. This can be factored out from - Process.children() and exposed as a first class function. - PROS: on Windows we can take advantage of _psutil_windows.ppid_map() - which is faster than iterating over all pids and calling ppid(). - CONS: scripts/pstree.py shows this can be easily done in the user code - so maybe it's not worth the addition. +- psutil.proc_tree() something which obtains a {pid:ppid, ...} dict for + all running processes in one shot. This can be factored out from + Process.children() and exposed as a first class function. + PROS: on Windows we can take advantage of _psutil_windows.ppid_map() + which is faster than iterating over all pids and calling ppid(). + CONS: scripts/pstree.py shows this can be easily done in the user code + so maybe it's not worth the addition. - * advanced cmdline interface exposing the whole API and providing different - kind of outputs (e.g. pprinted, colorized, json). +- advanced cmdline interface exposing the whole API and providing different + kind of outputs (e.g. pprinted, colorized, json). - * [Linux]: process cgroups (http://en.wikipedia.org/wiki/Cgroups). They look - similar to prlimit() in terms of functionality but uglier (they should allow - limiting per-process network IO resources though, which is great). Needs - further reading. +- [Linux]: process cgroups (http://en.wikipedia.org/wiki/Cgroups). They look + similar to prlimit() in terms of functionality but uglier (they should allow + limiting per-process network IO resources though, which is great). Needs + further reading. - * Python 3.3. exposed different sched.h functions: - http://docs.python.org/dev/whatsnew/3.3.html#os - http://bugs.python.org/issue12655 - http://docs.python.org/dev/library/os.html#interface-to-the-scheduler - It might be worth to take a look and figure out whether we can include some - of those in psutil. - Also, we can probably reimplement wait_pid() on POSIX which is currently - implemented as a busy-loop. +- Python 3.3. exposed different sched.h functions: + http://docs.python.org/dev/whatsnew/3.3.html#os + http://bugs.python.org/issue12655 + http://docs.python.org/dev/library/os.html#interface-to-the-scheduler + It might be worth to take a look and figure out whether we can include some + of those in psutil. + Also, we can probably reimplement wait_pid() on POSIX which is currently + implemented as a busy-loop. - * Certain systems provide CPU times about process children. On those systems - Process.cpu_times() might return a (user, system, user_children, - system_children) ntuple. - * Linux: /proc/{PID}/stat - * Solaris: pr_cutime and pr_cstime - * FreeBSD: none - * OSX: none - * Windows: none +- Certain systems provide CPU times about process children. On those systems + Process.cpu_times() might return a (user, system, user_children, + system_children) ntuple. + - Linux: /proc/{PID}/stat + - Solaris: pr_cutime and pr_cstime + - FreeBSD: none + - OSX: none + - Windows: none - * ...also, os.times() provides 'elapsed' times as well. +- ...also, os.times() provides 'elapsed' times as well. - * ...also Linux provides guest_time and cguest_time. +- ...also Linux provides guest_time and cguest_time. - * Enrich exception classes hierarchy on Python >= 3.3 / post PEP-3151 so that: +- Enrich exception classes hierarchy on Python >= 3.3 / post PEP-3151 so that: - NoSuchProcess inherits from ProcessLookupError - AccessDenied inherits from PermissionError - TimeoutExpired inherits from TimeoutError (debatable) See: http://docs.python.org/3/library/exceptions.html#os-exceptions - * Process.threads() might grow an extra "id" parameter so that it can be +- Process.threads() might grow an extra "id" parameter so that it can be used as such: - - >>> p = psutil.Process(os.getpid()) - >>> p.threads(id=psutil.current_thread_id()) - thread(id=2539, user_time=0.03, system_time=0.02) - >>> - - Note: this leads to questions such as "should we have a custom NoSuchThread - exception? Also see issue #418. - - Note #2: this would work with os.getpid() only. - psutil.current_thread_id() might be desirable as per issue #418 though. - - * should psutil.TimeoutExpired exception have a 'msg' kwarg similar to - NoSuchProcess and AccessDenied? Not that we need it, but currently we - cannot raise a TimeoutExpired exception with a specific error string. - - * process_iter() might grow an "attrs" parameter similar to Process.as_dict() - invoke the necessary methods and include the results into a "cache" - attribute attached to the returned Process instances so that one can avoid - catching NSP and AccessDenied: - for p in process_iter(attrs=['cpu_percent']): - print(p.cache['cpu_percent']) - This also leads questions as whether we should introduce a sorting order. - - * round Process.memory_percent() result? - - * #550: number of threads per core. - - * Have psutil.Process().cpu_affinity([]) be an alias for "all CPUs"? + ``` + >>> p = psutil.Process(os.getpid()) + >>> p.threads(id=psutil.current_thread_id()) + thread(id=2539, user_time=0.03, system_time=0.02) + >>> + ``` + Note: this leads to questions such as "should we have a custom NoSuchThread + exception? Also see issue #418. + Note #2: this would work with os.getpid() only. + psutil.current_thread_id() might be desirable as per issue #418 though. + +- should psutil.TimeoutExpired exception have a 'msg' kwarg similar to + NoSuchProcess and AccessDenied? Not that we need it, but currently we + cannot raise a TimeoutExpired exception with a specific error string. + +- process_iter() might grow an "attrs" parameter similar to Process.as_dict() + invoke the necessary methods and include the results into a "cache" + attribute attached to the returned Process instances so that one can avoid + catching NSP and AccessDenied: + for p in process_iter(attrs=['cpu_percent']): + print(p.cache['cpu_percent']) + This also leads questions as whether we should introduce a sorting order. + +- round Process.memory_percent() result? + +- #550: number of threads per core. + +- Have psutil.Process().cpu_affinity([]) be an alias for "all CPUs"? |