Commit 3886665c by Bach Dániel

dashboard: fix calvin

parent 15a3ba50
......@@ -9,7 +9,7 @@
style="width: {% widthratio record.cpu_usage 1 100 %}%;">
<span class="progress-bar-text">
{% if record.cpu_usage != None %}
{{ record.cpu_usage|floatformat:1 }} %
{% widthratio record.cpu_usage 1 100 %} %
{% else %}
-
{% endif %}
......
......@@ -246,6 +246,7 @@ class Node(OperatedMixin, TimeStampedModel):
return default
@node_available
@method_cache(10)
def get_monitor_info(self):
try:
handler = GraphiteHandler()
......@@ -269,7 +270,7 @@ class Node(OperatedMixin, TimeStampedModel):
for metric in metrics:
response = handler.pop()
try:
cache = response[0]["datapoints"][-1][0]
cache = response[0]["datapoints"][-2][0]
except (IndexError, KeyError):
cache = 0
if cache is None:
......
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