Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f249f807
authored
Apr 14, 2024
by
Duchaj János
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the GPU usage monitoring, and all Disk IO R/W monitoring.
parent
cd77d510
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
circle/dashboard/templates/dashboard/node-detail/home.html
+2
-0
circle/dashboard/views/graph.py
+63
-2
No files found.
circle/dashboard/templates/dashboard/node-detail/home.html
View file @
f249f807
...
...
@@ -42,6 +42,8 @@
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
network
"
graph_time
%}"
/>
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
vm
"
graph_time
%}"
/>
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
alloc
"
graph_time
%}"
/>
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
io
"
graph_time
%}"
/>
<img
src=
"{% url "
dashboard
.
views
.
node-graph
"
node
.
pk
"
gpu
"
graph_time
%}"
/>
</div>
{% endif %}
</div>
...
...
circle/dashboard/views/graph.py
View file @
f249f807
...
...
@@ -107,12 +107,20 @@ class Metric(object):
target
=
'cactiStyle(
%
s)'
%
target
return
target
def
get_graph
(
self
,
graphite_url
,
time
,
width
=
500
,
height
=
200
):
def
get_graph_height
(
self
):
return
200
def
get_graph_colorList
(
self
):
return
'default'
def
get_graph
(
self
,
graphite_url
,
time
,
width
=
500
):
params
=
{
'target'
:
self
.
get_target
(),
'from'
:
'-
%
s'
%
time
,
'title'
:
self
.
get_title
()
.
encode
(
'UTF-8'
),
'width'
:
width
,
'height'
:
height
}
'height'
:
self
.
get_graph_height
(),
'hideLegend'
:
'false'
,
'colorList'
:
self
.
get_graph_colorList
()}
ymin
,
ymax
=
self
.
get_minmax
()
if
ymin
is
not
None
:
...
...
@@ -219,6 +227,24 @@ register_graph(Cpu, 'cpu', VmGraphView)
register_graph
(
Cpu
,
'cpu'
,
NodeGraphView
)
class
Gpu
(
object
):
title
=
_
(
"GPU usage (
%
)"
)
def
get_minmax
(
self
):
return
(
0
,
105
)
def
get_graph_height
(
self
):
gpu_numbers
=
1
return
super
()
.
get_graph_height
()
+
(
gpu_numbers
-
1
)
*
15
def
get_target
(
self
):
return
(
'cactiStyle(aliasSub(
%
s.gpu.percent.*,".*
\
.percent.([a-zA-Z0-9_]+).*","
\\
1"))'
%
(
self
.
obj
.
metric_prefix
))
register_graph
(
Gpu
,
'gpu'
,
NodeGraphView
)
class
VmNetwork
(
object
):
title
=
_
(
"Network"
)
...
...
@@ -288,6 +314,10 @@ class NodeAllocated(object):
def
get_minmax
(
self
):
return
(
0
,
None
)
def
get_graph_height
(
self
):
graph_lines
=
3
return
super
()
.
get_graph_height
()
+
graph_lines
*
15
register_graph
(
NodeAllocated
,
'alloc'
,
NodeGraphView
)
...
...
@@ -305,6 +335,10 @@ class NodeListAllocated(object):
n
.
ram_size
for
n
in
nodes
if
n
.
online
)
return
(
'group(aliasSub(aliasByNode(stacked(group(
%
s)), 1), "$",'
'" (used)"),
%
s,
%
s)'
%
(
used
,
allocated
,
max
))
def
get_graph_height
(
self
):
legendsRows
=
3
return
super
()
.
get_graph_height
()
+
(
legendsRows
-
1
)
*
15
def
get_minmax
(
self
):
return
(
0
,
None
)
...
...
@@ -325,3 +359,30 @@ class NodeListVms(object):
register_graph
(
NodeListVms
,
'vm'
,
NodeListGraphView
)
class
NodeIOReadWrite
(
object
):
title
=
_
(
"IO (kilobytes)"
)
def
get_minmax
(
self
):
return
(
0
,
None
)
def
get_graph_height
(
self
):
legendsRows
=
7
return
super
()
.
get_graph_height
()
+
(
legendsRows
-
1
)
*
15
def
get_graph_colorList
(
self
):
return
(
'8B4513FF,A0522DFF,D2691EFF,CD853FFF,F4A460FF,BC8F8FFF,FFE4E1FF,708090FF,B0C4DEFF,E6E6FAFF,000000FF,696969FF,FF1493FF,DB7093FF,'
'C71585FF,800080FF,9932CCFF,9370DBFF,4B0082FF,0000FFFF,000080FF,87CEEBFF,1E90FFFF,6495EDFF,00BFFFFF,7FFFD4FF,008080FF,00FF7FFF,8FBC8FFF,00FF00FF'
)
def
get_target
(
self
):
return
(
# 'aliasSub(scaleToSeconds(group(%s.io\.*\.*),10), ".*\.(read|write)\.([a-zA-Z0-9\-_]+).*", "\\2 \\1")' % (
# self.obj.metric_prefix))
'aliasSub(scaleToSeconds(transformNull(
%
s.io.{write,read}
\
.[_a-zA-Z0-9]*),10), ".*
\
.(read|write)
\
.([a-zA-Z0-9
\
_-]+).*", "
\\
2
\\
1")'
%
(
self
.
obj
.
metric_prefix
))
register_graph
(
NodeIOReadWrite
,
'io'
,
NodeGraphView
)
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