Commit f249f807 by Duchaj János

Added the GPU usage monitoring, and all Disk IO R/W monitoring.

parent cd77d510
...@@ -42,6 +42,8 @@ ...@@ -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 "network" graph_time %}"/>
<img src="{% url "dashboard.views.node-graph" node.pk "vm" 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 "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> </div>
{% endif %} {% endif %}
</div> </div>
......
...@@ -107,12 +107,20 @@ class Metric(object): ...@@ -107,12 +107,20 @@ class Metric(object):
target = 'cactiStyle(%s)' % target target = 'cactiStyle(%s)' % target
return 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(), params = {'target': self.get_target(),
'from': '-%s' % time, 'from': '-%s' % time,
'title': self.get_title().encode('UTF-8'), 'title': self.get_title().encode('UTF-8'),
'width': width, 'width': width,
'height': height} 'height': self.get_graph_height(),
'hideLegend': 'false',
'colorList': self.get_graph_colorList()}
ymin, ymax = self.get_minmax() ymin, ymax = self.get_minmax()
if ymin is not None: if ymin is not None:
...@@ -219,6 +227,24 @@ register_graph(Cpu, 'cpu', VmGraphView) ...@@ -219,6 +227,24 @@ register_graph(Cpu, 'cpu', VmGraphView)
register_graph(Cpu, 'cpu', NodeGraphView) 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): class VmNetwork(object):
title = _("Network") title = _("Network")
...@@ -288,6 +314,10 @@ class NodeAllocated(object): ...@@ -288,6 +314,10 @@ class NodeAllocated(object):
def get_minmax(self): def get_minmax(self):
return (0, None) return (0, None)
def get_graph_height(self):
graph_lines = 3
return super().get_graph_height() + graph_lines * 15
register_graph(NodeAllocated, 'alloc', NodeGraphView) register_graph(NodeAllocated, 'alloc', NodeGraphView)
...@@ -305,6 +335,10 @@ class NodeListAllocated(object): ...@@ -305,6 +335,10 @@ class NodeListAllocated(object):
n.ram_size for n in nodes if n.online) n.ram_size for n in nodes if n.online)
return ('group(aliasSub(aliasByNode(stacked(group(%s)), 1), "$",' return ('group(aliasSub(aliasByNode(stacked(group(%s)), 1), "$",'
'" (used)"), %s, %s)' % (used, allocated, max)) '" (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): def get_minmax(self):
return (0, None) return (0, None)
...@@ -325,3 +359,30 @@ class NodeListVms(object): ...@@ -325,3 +359,30 @@ class NodeListVms(object):
register_graph(NodeListVms, 'vm', NodeListGraphView) 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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment