Skip to content

Commit

Permalink
Rename psutil_get_swappercent to psutil_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 12, 2023
1 parent c2460e0 commit 64ea208
Show file tree
Hide file tree
Showing 3 changed files with 4 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 @@ -1599,7 +1599,7 @@ PsutilMethods[] = {
{"disk_usage", psutil_disk_usage, METH_VARARGS},
{"getloadavg", (PyCFunction)psutil_get_loadavg, METH_VARARGS},
{"getpagesize", psutil_getpagesize, METH_VARARGS},
{"getpercentswap", (PyCFunction)psutil_get_percentswap, METH_VARARGS},
{"getpercentswap", (PyCFunction)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
3 changes: 2 additions & 1 deletion psutil/arch/windows/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ psutil_get_loadavg(PyObject *self, PyObject *args) {
* the system.
*/
PyObject *
psutil_get_percentswap(PyObject *self, PyObject *args) {
psutil_swap_percent(PyObject *self, PyObject *args) {
WCHAR *szCounterPath = L"\\Paging File(_Total)\\% Usage";
PDH_STATUS s;
HQUERY hQuery;
Expand All @@ -146,6 +146,7 @@ psutil_get_percentswap(PyObject *self, PyObject *args) {

s = PdhAddEnglishCounterW(hQuery, szCounterPath, 0, &hCounter);
if (s != ERROR_SUCCESS) {
PdhCloseQuery(hQuery);
PyErr_Format(
PyExc_RuntimeError,
"PdhAddEnglishCounterW failed. Performance counters may be disabled."
Expand Down
2 changes: 1 addition & 1 deletion psutil/arch/windows/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

PyObject* psutil_init_loadavg_counter();
PyObject* psutil_get_loadavg();
PyObject* psutil_get_percentswap();
PyObject* psutil_swap_percent();

0 comments on commit 64ea208

Please sign in to comment.