Commit 3886665c by Bach Dániel

dashboard: fix calvin

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