{% extends 'layout-single.html' %} {% block title %}Heartbear Servers State{% endblock %} {% block content %} {##}
Expand All Collapse All
{% for host, info in hosts | dictsort %} {% set lim = { '!': { '!': { 'queue': 1000, 'rate': 500, 'busy': 0.1 }, 'all': { 'queue': 500, 'rate': 100, 'busy': 0.25 } }, 'all': { '!': { 'queue': 1000, 'rate': 100, 'busy': 0.2 }, 'all': { 'queue': 20, 'rate': 10, 'busy': 0.33 } } } %} {% set hostlim = lim.get(host, lim['all']) %} {% set open = [] %} {% for pn,pd in info['plugins'] | dictsort %} {% set mlim = hostlim.get(pn, hostlim['all']) %} {% if pd['queue'] > mlim['queue'] or pd['busy'] > mlim['busy'] %} {% if open.append(1) %}{% endif %} {% endif %} {% endfor %} {% if host == '!' %}{% set host = 'Overall' %}{% endif %} {% if open %}

{{ host }} !!!

{% else %}

{{host}}

{% endif %}
{% if 'last_update' in info %} {% else %} {% endif %}
Uptime:  {{ tdfmt(info['uptime']) }}
Last update: {{ dtfmt(info['last_update']) }} {{ dtfmt(info['min_last_update']) }} (min) {{ dtfmt(info['max_last_update']) }} (max)
Clients:  {{ numfmt('%d', info['clients']) }} (which sent at least one report for last hour).
{% for pn, pd in info['plugins'] | dictsort %} {% set mlim = hostlim.get(pn, hostlim['all']) %} {% if pn != '!' %} {% set open2 = [] %} {% if pd['queue'] > mlim['queue'] or pd['busy'] > mlim['busy'] %} {% if open2.append(1) %}{% endif %} {% endif %} {% endif %} {% if open and pn == '!' or open2 %}

{{ pn.replace('!', 'Overall') }} !!!

{% else %}

{{ pn.replace('!', 'Overall') }}

{% endif %}
{% if 'aliases' in pd %} {% else %} {% endif %} {% if 'instances' not in pd %} {% else %} {% set warn = pd['queue'] > mlim['queue'] %} {% set warn_desc = mlim['queue'] %} {% set warn = pd['rate'] > mlim['rate'] %} {% set warn_desc = mlim['rate'] %} {% set warn = pd['busy'] > mlim['busy'] %} {% set warn_desc = numfmt('%d', mlim['busy'] * 100) + '%' %} {% if pd['psize'] != 0 %} {% else %} {% endif %} {% endif %}
Aliases: {{ len(pd['aliases']) }} {{ ', '.join(pd['aliases']) }}
Redirect: {{ pd['redirect'] }}
Instances: {{ numfmt('%d', pd['instances']) }} process(es)
Restarts: {{ numfmt('%d', pd.get('restarts', 0)) }} times
Restarts (crit): {{ numfmt('%d', pd.get('restarts_critical', 0)) }} times
Restarts (init): {{ numfmt('%d', pd.get('restarts_initial', 0)) }} timesQueue Size: {% if warn %} {% endif %} {{ numfmt('%d', pd['queue']) }} reports
Queue Data Size: {% set qsize = szfmt(pd.get('queue_data', 0)) %} {% if qsize.endswith('iB') %} {{ qsize[:-3] }} {% set qsize_m = qsize[-3:] %} {% else %} {{ qsize[:-7] }} {% set qsize_m = qsize[-7:] %} {% endif %} {{qsize_m}}
Discards: {{ numfmt('%d', pd['discards']) }} reports
Request Rate: {% if warn %} {% endif %} {% if pd['rate'] < 1 %} {{ numfmt('%.2f', pd['rate']) }} {% else %} {{ numfmt('%d', pd['rate']) }} {% endif %} rps [30sec avg]
Busy: {% if warn %} {% endif %} {{ numfmt('%.2f', pd['busy'] * 100) }}% work/sleep time [30sec avg]
Compressed Request Size: {{ szfmt(pd['psize']) }} [30sec avg]
Decompressed Request Size: {{ szfmt(pd['upsize']) }} ({{ numfmt('%.2f', pd['upsize'] / pd['psize']) }}x) [30sec avg] ({{ numfmt('%.2f', pd['upsize']) }}x) [30sec avg]
Total Requests: {{ numfmt('%d', pd['requests']) }} request(s)
{% endfor %}
{% endfor %}
{% endblock %}