Skip to content

Commit

Permalink
Rename getpercentswap to swap_percent
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Apr 13, 2023
1 parent 06ebf96 commit 34a3cbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion psutil/_psutil_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,7 @@ PsutilMethods[] = {
{"disk_usage", psutil_disk_usage, METH_VARARGS},
{"getloadavg", (PyCFunction)psutil_get_loadavg, METH_VARARGS},
{"getpagesize", psutil_getpagesize, METH_VARARGS},
{"getpercentswap", (PyCFunction)psutil_swap_percent, METH_VARARGS},
{"swap_percent", psutil_swap_percent, METH_VARARGS},
{"init_loadavg_counter", (PyCFunction)psutil_init_loadavg_counter, METH_VARARGS},
{"net_connections", psutil_net_connections, METH_VARARGS},
{"net_if_addrs", psutil_net_if_addrs, METH_VARARGS},
Expand Down
4 changes: 2 additions & 2 deletions psutil/_pswindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ def swap_memory():
# pages are accessed, so we can't use free system memory for swap.
# instead, we calculate page file usage based on performance counter
if (total > 0):
percentswap = cext.getpercentswap()
percentswap = cext.swap_percent()
used = int(0.01 * percentswap * total)
else:
used = 0
free = total - used
percent = usage_percent(used, total, round_=1)
percent = round(percentswap, round_=1)
return _common.sswap(total, used, free, percent, 0, 0)


Expand Down

0 comments on commit 34a3cbf

Please sign in to comment.