mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
improved get_memusage
This commit is contained in:
@@ -2492,12 +2492,13 @@ PyObject *py_uwsgi_logsize(PyObject * self, PyObject * args) {
|
||||
|
||||
PyObject *py_uwsgi_mem(PyObject * self, PyObject * args) {
|
||||
|
||||
uint64_t rss=0, vsz = 0;
|
||||
PyObject *ml = PyTuple_New(2);
|
||||
|
||||
get_memusage();
|
||||
get_memusage(&rss, &vsz);
|
||||
|
||||
PyTuple_SetItem(ml, 0, PyLong_FromUnsignedLongLong(uwsgi.workers[uwsgi.mywid].rss_size));
|
||||
PyTuple_SetItem(ml, 1, PyLong_FromUnsignedLongLong(uwsgi.workers[uwsgi.mywid].vsz_size));
|
||||
PyTuple_SetItem(ml, 0, PyLong_FromUnsignedLongLong(rss));
|
||||
PyTuple_SetItem(ml, 1, PyLong_FromUnsignedLongLong(vsz));
|
||||
|
||||
return ml;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user