summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* give CREDITS to @sansecio for the new sponsorshipGiampaolo Rodola2021-05-141-1/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Re. #1210: add doc warning explaining that cpu_times() values can sometimes ↵Giampaolo Rodola2021-05-031-0/+6
| | | | | | go backwards Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add @cybersecgeek to sponsorsGiampaolo Rodola2021-04-061-0/+1
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* update DEVNOTESGiampaolo Rodola2021-01-181-52/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Merge branch 'master' of github.com:giampaolo/psutilGiampaolo Rodola2020-12-291-1/+1
|\
| * Fix typo in index.rst (#1899)Andre F de Miranda2020-12-291-1/+1
| |
* | update docGiampaolo Rodola2020-12-291-12/+2
|/ | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* give CREDITS to @aristocratos for new sponsorship (thank you ;))Giampaolo Rodola2020-12-281-1/+2
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* update docGiampaolo Rodola2020-12-272-8/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* Rename cpu_count_physical() to cpu_count_cores()Giampaolo Rodola2020-12-211-8/+8
| | | | | | | | | | This has always been cause of confusion, e.g. see: https://github.com/giampaolo/psutil/pull/1727#issuecomment-698934643 Removed the reference to "physical" from dostrings, functions and test. I still left it in the doc though, as it's more explanatory. Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* update docGiampaolo Rodola2020-12-191-1/+2
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* pre-releaseGiampaolo Rodola2020-12-191-0/+4
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* add CONTRIBUTING.mdGiampaolo Rodola2020-12-132-33/+21
|
* Remove Travis and Cirrus, use GH also for FreeBSD (#1880)Giampaolo Rodola2020-11-151-14/+5
|
* remove misleading "in UTC" (#1882)zed2020-11-151-1/+1
| | | | | | | | | | | | | | | | | "seconds since the epoch" (value returned by `time.time()`) doesn't depend on the local time zone. It is the same time instance around the world. It is not in any particular time zone: ```python import datetime as DT import zoneinfo local_time = DT.datetime.fromtimestamp(seconds_since_epoch) # naive datetime object representing local time utc_time = DT.datetime.utcfromtimestamp(seconds_since_epoch) # naive datetime object representing utc time la_time = DT.datetime.fromtimestamp(seconds_since_epoch, zoneinfo.ZoneInfo("America/Los_Angeles")) # timezone aware dt ``` Here `local_time`, `utc_time`, `la_time` may correspond to different clock times but it is exactly the same time instance.
* Rewrite Linux prlimit() with ctypes (Linux wheels) (#1879)Giampaolo Rodola2020-11-152-92/+69
|
* Fix definition of RPM (#1870)Christopher Hewett2020-11-041-1/+1
| | | RPM is actually revolutions per minute, current docs say its rounds per minute
* disk_partitions() maxfile and maxpath (#1863)Giampaolo Rodola2020-10-241-11/+19
|
* pre releaseGiampaolo Rodola2020-10-231-1/+5
|
* [FreeBSD] process resource limits (#1859) (#809)Giampaolo Rodola2020-10-232-38/+49
|
* fix #1855 docGiampaolo Rodola2020-10-191-1/+4
|
* add sponsors in docGiampaolo Rodola2020-10-181-16/+45
|
* Update README (#1854)Giampaolo Rodola2020-10-182-0/+0
|
* Fix labeling in Process cpu_times() documentation (#1853)kellurs2020-10-151-1/+1
| | | Changed system_user to children_system to match the named tupple and expected behaviour. Change description to match.
* Update index.rst (#1835)Piotr Dworzynski2020-10-091-1/+1
| | | Fixed typo in documentation of user.name attribute.
* update doc for #1830 (net_if_stats() isup check if NIC is running)Giampaolo Rodola2020-09-211-1/+3
|
* give CREDITS for #1800 / @ArminGrunnerGiampaolo Rodola2020-08-131-2/+1
|
* pre-releaserelease-5.7.2Giampaolo Rodola2020-07-151-0/+1
|
* pre-releaseGiampaolo Rodola2020-07-151-0/+4
|
* pre-releaserelease-5.7.1Giampaolo Rodola2020-07-151-0/+4
|
* update personal site URLGiampaolo Rodola2020-06-161-3/+3
|
* update docGiampaolo Rodola2020-06-101-5/+6
|
* Memory leak test: take fluctuations into account (#1757)Giampaolo Rodola2020-05-131-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preamble ======= We have a [memory leak test suite](https://github.com/giampaolo/psutil/blob/e1ea2bccf8aea404dca0f79398f36f37217c45f6/psutil/tests/__init__.py#L897), which calls a function many times and fails if the process memory increased. We do this in order to detect missing `free()` or `Py_DECREF` calls in the C modules. When we do, then we have a memory leak. The problem ========== A problem we've been having for probably over 10 years, is the false positives. That's because the memory fluctuates. Sometimes it may increase (or even decrease!) due to how the OS handles memory, the Python's garbage collector, the fact that RSS is an approximation and who knows what else. So thus far we tried to compensate that by using the following logic: - warmup (call fun 10 times) - call the function many times (1000) - if memory increased before/after calling function 1000 times, then keep calling it for another 3 secs - if it still increased at all (> 0) then fail This logic didn't really solve the problem, as we still had occasional false positives, especially lately on FreeBSD. The solution ========= This PR changes the internal algorithm so that in case of failure (mem > 0 after calling fun() N times) we retry the test for up to 5 times, increasing N (repetitions) each time, so we consider it a failure only if the memory **keeps increasing** between runs. So for instance, here's a legitimate failure: ``` psutil.tests.test_memory_leaks.TestModuleFunctionsLeaks.test_disk_partitions ... Run #1: extra-mem=696.0K, per-call=3.5K, calls=200 Run #2: extra-mem=1.4M, per-call=3.5K, calls=400 Run #3: extra-mem=2.1M, per-call=3.5K, calls=600 Run #4: extra-mem=2.7M, per-call=3.5K, calls=800 Run #5: extra-mem=3.4M, per-call=3.5K, calls=1000 FAIL ``` If, on the other hand, the memory increased on one run (say 200 calls) but decreased on the next run (say 400 calls), then it clearly means it's a false positive, because memory consumption may be > 0 on second run, but if it's lower than the previous run with less repetitions, then it cannot possibly represent a leak (just a fluctuation): ``` psutil.tests.test_memory_leaks.TestModuleFunctionsLeaks.test_net_connections ... Run #1: extra-mem=568.0K, per-call=2.8K, calls=200 Run #2: extra-mem=24.0K, per-call=61.4B, calls=400 OK ``` Note about mallinfo() ================ Aka #1275. `mallinfo()` on Linux is supposed to provide memory metrics about how many bytes gets allocated on the heap by `malloc()`, so it's supposed to be way more precise than RSS and also [USS](http://grodola.blogspot.com/2016/02/psutil-4-real-process-memory-and-environ.html). In another branch were I exposed it, I verified that fluctuations still occur even when using `mallinfo()` though, despite less often. So that means even `mallinfo()` would not grant 100% stability.
* Process wait() improvements (#1747)Giampaolo Rodola2020-05-032-19/+35
| | | | | | | | | | | | | | | | | | | | | | * `Process.wait()` on POSIX now returns an `enum` showing the negative which was used to terminate the process: ```python >>> import psutil >>> p = psutil.Process(9891) >>> p.terminate() >>> p.wait() <Negsignal.SIGTERM: -15> ``` * the return value is cached so that the exit code can be retrieved on then next call, mimicking `subprocess.Popen.wait()` * `Process` object provides more `status` and `exitcode` additional info on `str()` and `repr()`: ``` >>> proc psutil.Process(pid=12739, name='python3', status='terminated', exitcode=<Negsigs.SIGTERM: -15>, started='15:08:20') ``` Extra: * improved `wait()` doc * reverted #1736: `psutil.Popen` uses original `subprocess.Popen.wait` method (safer)
* Revert #1736: Popen inheriting from subprocess (#1744)Giampaolo Rodola2020-05-011-34/+13
|
* psutil.Popen: inherit from subprocess + support wait(timeout=...) parameter ↵Giampaolo Rodola2020-04-281-12/+15
| | | | (#1736)
* Parallel tests (UNIX) (#1709)Giampaolo Rodola2020-04-261-6/+7
|
* sensors_fans is not available on MacOS (#1710)crusaderky2020-03-041-1/+1
|
* Git hook for renamed/added/deleted files + flake8 print() + tidelift (#1704)Giampaolo Rodola2020-02-211-2/+1
|
* Add C linter script (#1698)Giampaolo Rodola2020-02-182-1/+5
|
* revert process_iter() exactly how it was pre #1667Giampaolo Rodola2020-02-181-2/+3
|
* revert #1667 process_iter() new_only paramGiampaolo Rodola2020-02-181-12/+1
| | | | | | | | | | On a second thought I realized that process_iter() uses a global variable, so it's not thread safe. That means that if the are 2 threads using it, the first thread one calling the function (+ consume the iterator), will "steal" the processes of the second thread. psutil.cpu_percent() has the same problem. That means we have a problem can't solve with the current API and requires a lot of thinking on how to solve it as it's not obvious.
* refactor print colors utilsGiampaolo Rodola2020-02-151-0/+7
|
* update docGiampaolo Rodola2020-02-151-0/+3
|
* update docGiampaolo Rodola2020-02-151-3/+3
|
* update docGiampaolo Rodola2020-02-151-10/+10
|
* update docGiampaolo Rodola2020-02-151-27/+18
|
* #1681, revert 00a3398Giampaolo Rodola2020-02-131-2/+0
|
* refactor docGiampaolo Rodola2020-02-124-166/+47
|
* small refactGiampaolo Rodola2020-02-111-1/+1
|