Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
93d05776
authored
Mar 20, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added get_architecture and get_info
parent
fb1c7658
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
vmdriver.py
+17
-0
No files found.
vmdriver.py
View file @
93d05776
...
@@ -6,6 +6,7 @@ import sys
...
@@ -6,6 +6,7 @@ import sys
import
socket
import
socket
import
json
import
json
from
decorator
import
decorator
from
decorator
import
decorator
import
lxml.etree
as
ET
from
psutil
import
NUM_CPUS
,
virtual_memory
,
cpu_percent
from
psutil
import
NUM_CPUS
,
virtual_memory
,
cpu_percent
...
@@ -551,6 +552,15 @@ def ping():
...
@@ -551,6 +552,15 @@ def ping():
@celery.task
@celery.task
@req_connection
@wrap_libvirtError
def
get_architecture
():
xml
=
Connection
.
get
()
.
getCapabilities
()
return
ET
.
fromstring
(
xml
)
.
getchildren
()[
0
]
.
getchildren
(
)[
1
]
.
getchildren
()[
0
]
.
text
@celery.task
def
get_core_num
():
def
get_core_num
():
return
NUM_CPUS
return
NUM_CPUS
...
@@ -561,6 +571,13 @@ def get_ram_size():
...
@@ -561,6 +571,13 @@ def get_ram_size():
@celery.task
@celery.task
def
get_info
():
return
{
'core_num'
:
get_core_num
(),
'ram_size'
:
get_ram_size
(),
'architecture'
:
get_architecture
()}
@celery.task
def
get_node_metrics
():
def
get_node_metrics
():
result
=
{}
result
=
{}
result
[
'cpu.usage'
]
=
cpu_percent
(
0
)
result
[
'cpu.usage'
]
=
cpu_percent
(
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment