Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1709803c
authored
Feb 07, 2014
by
Gregory Nagy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added get_node_metrics function to collect metrics from the node
parent
9673bb0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
vmdriver.py
+9
-1
No files found.
vmdriver.py
View file @
1709803c
...
...
@@ -7,7 +7,7 @@ import socket
import
json
from
decorator
import
decorator
from
psutil
import
NUM_CPUS
,
virtual_memory
from
psutil
import
NUM_CPUS
,
virtual_memory
,
virtmem_usage
,
cpu_percent
from
vm
import
VMInstance
...
...
@@ -521,3 +521,11 @@ def get_core_num():
@celery.task
def
get_ram_size
():
return
virtual_memory
()
.
total
@celery.task
def
get_node_metrics
():
result
=
{}
result
[
'cpu.usage'
]
=
cpu_percent
(
0
)
result
[
'memory.usage'
]
=
virtmem_usage
.
percent
()
return
result
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