1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-01-12 08:25:18 +00:00

Merge pull request #590 from catborise/master

update req & fixes
This commit is contained in:
catborise 2023-07-11 11:16:34 +03:00 committed by GitHub
commit 82de7f4262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 13 deletions

View file

@ -51,7 +51,7 @@ class Compute(Model):
@cached_property @cached_property
def cpu_usage(self): def cpu_usage(self):
return round(self.proxy.get_cpu_usage().get('usage')) return round(self.proxy.get_cpu_usage(diff=False).get('usage'))
@cached_property @cached_property
def ram_size(self): def ram_size(self):

View file

@ -1,22 +1,22 @@
Django==3.2.19 Django==3.2.20
django_bootstrap5==23.1 django_bootstrap5==23.3
django-login-required-middleware==0.9.0 django-login-required-middleware==0.9.0
django-otp==1.1.6 django-otp==1.2.2
django-icons==23.2 django-icons==23.3
django-qr-code==3.1.1 django-qr-code==3.1.1
gunicorn==20.1.0 gunicorn==20.1.0
libsass==0.22.0 libsass==0.22.0
libvirt-python==9.3.0 libvirt-python==9.5.0
lxml==4.9.2 lxml==4.9.3
qrcode==7.4.2 qrcode==7.4.2
rwlock==0.0.7 rwlock==0.0.7
websockify==0.10.0 websockify==0.10.0
zipp==3.13.0 zipp==3.13.0
ldap3==2.9.1 ldap3==2.9.1
python-engineio==4.4.1 python-engineio==4.5.1
python-socketio==5.8.0 python-socketio==5.8.0
eventlet==0.33.3 eventlet==0.33.3
djangorestframework==3.14.0 djangorestframework==3.14.0
drf-nested-routers==0.93.4 drf-nested-routers==0.93.4
drf-yasg==1.21.5 drf-yasg==1.21.6
markdown>=3.4.1 markdown>=3.4.1

View file

@ -1,8 +1,8 @@
-r ../conf/requirements.txt -r ../conf/requirements.txt
coverage==7.2.5 coverage==7.2.7
django-debug-toolbar==4.0.0 django-debug-toolbar==4.1.0
pycodestyle==2.10.0 pycodestyle==2.10.0
pyflakes==3.0.1 pyflakes==3.0.1
pylint==2.17.4 pylint==2.17.4
yapf==0.33.0 yapf==0.33.0
black==23.3.0 black==23.7.0

View file

@ -27,7 +27,7 @@ class wvmHostDetails(wvmConnect):
else: else:
return {"total": None, "usage": None, "percent": None} return {"total": None, "usage": None, "percent": None}
def get_cpu_usage(self): def get_cpu_usage(self, diff=True):
""" """
Function return cpu usage on node. Function return cpu usage on node.
""" """
@ -43,6 +43,8 @@ class wvmHostDetails(wvmConnect):
diff_idle = idle - prev_idle diff_idle = idle - prev_idle
diff_total = total - prev_total diff_total = total - prev_total
diff_usage = (1000 * (diff_total - diff_idle) / diff_total + 5) / 10 diff_usage = (1000 * (diff_total - diff_idle) / diff_total + 5) / 10
if not diff:
return {"usage": diff_usage}
prev_total = total prev_total = total
prev_idle = idle prev_idle = idle
if num == 0: if num == 0: