Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
0dd6ed5e
Commit
0dd6ed5e
authored
10 years ago
by
Antoine Millet
Browse files
Options
Downloads
Patches
Plain Diff
Implemented memallocratio tag
parent
dbd39755
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cloudcontrol/node/hypervisor/__init__.py
+1
-1
1 addition, 1 deletion
cloudcontrol/node/hypervisor/__init__.py
cloudcontrol/node/hypervisor/tags.py
+9
-1
9 additions, 1 deletion
cloudcontrol/node/hypervisor/tags.py
with
10 additions
and
2 deletions
cloudcontrol/node/hypervisor/__init__.py
+
1
−
1
View file @
0dd6ed5e
...
...
@@ -125,7 +125,7 @@ class Handler(HostHandler):
# we must refresh those tags only when domains tags are registered to
# have the calculated values
for
tag
in
(
'
cpualloc
'
,
'
cpurunning
'
,
'
cpuremaining
'
,
'
cpuallocratio
'
,
'
memalloc
'
,
'
memrunning
'
,
'
memremaining
'
):
for
tag
in
(
'
cpualloc
'
,
'
cpurunning
'
,
'
cpuremaining
'
,
'
cpuallocratio
'
,
'
memalloc
'
,
'
memrunning
'
,
'
memremaining
'
,
'
memallocratio
'
):
self
.
tag_db
[
'
__main__
'
][
tag
].
update_value
()
# register libvirt handlers
...
...
This diff is collapsed.
Click to expand it.
cloudcontrol/node/hypervisor/tags.py
+
9
−
1
View file @
0dd6ed5e
...
...
@@ -199,4 +199,12 @@ def memremaining(handl):
"""
Allocatable memory remaining on the hypervisor.
"""
mem
=
int
(
handl
.
tag_db
[
'
__main__
'
][
'
mem
'
].
value
)
memalloc
=
int
(
handl
.
tag_db
[
'
__main__
'
][
'
memalloc
'
].
value
)
return
mem
-
memalloc
\ No newline at end of file
return
mem
-
memalloc
@_check_virt_connected
def
memallocratio
(
handl
):
"""
Allocated memory ratio on the hypervisor.
"""
mem
=
float
(
handl
.
tag_db
[
'
__main__
'
][
'
mem
'
].
value
)
memalloc
=
float
(
handl
.
tag_db
[
'
__main__
'
][
'
memalloc
'
].
value
)
return
'
%0.2f
'
%
(
memalloc
/
mem
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment