Fix Node Ordering when Node count > 10. Use rows to page 20 nodes at a time.

+ Attempted to make this as robust as possibly
+ Made the batching of hosts configurable.

Change-Id: I228859b4626e02514574b22f9e2b1512aa7ae3ed
This commit is contained in:
Alex Krzos
2016-02-26 21:31:49 -05:00
parent 1302230f2d
commit aa33129a41
6 changed files with 171 additions and 86 deletions

View File

@@ -0,0 +1,20 @@
def hosts_to_dictionary(arg):
"""Changes list format of hosts to dictionary format. The key of the dictionary is the index
of the host. The index is defined by the host's suffix, example: overcloud-controller-10 is 10.
If there is no suffix, I use an increamented value above 1000000."""
dictionary = {}
nonindex = 1000000
for item in arg:
if '-' in item:
idx = item.rindex('-')
dictionary[int(item[idx + 1:])] = item
else:
nonindex += 1
dictionary[nonindex] = item
return dictionary
class FilterModule(object):
def filters(self):
return {'hosts_to_dictionary': hosts_to_dictionary}

View File

@@ -30,6 +30,9 @@ grafana_api_key: (Your Grafana API Key)
# Grafana Server IP Address (Can be hosted on the Graphite server)
grafana_host: 1.1.1.1
# Dashboards - Batch number of hosts per row for all-{cpu, memory, disk, network} dashboards
dashboards_batch: 20
# Port for Shaker (5555 should suffice)
shaker_port: 5555

View File

@@ -1,5 +1,5 @@
{% set panel_idx = {'value': 0} %}
{% set osp_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{% set vars = {'panel_idx': 0, 'inital': 0} %}
{% set dashboard_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{
"dashboard": {
"id": null,
@@ -13,14 +13,20 @@
"hideControls": false,
"sharedCrosshair": false,
"rows": [
{% for group in osp_groups %}
{% for group in dashboard_groups %}
{% if group in groups %}
{% for batched_hosts in groups[group]|hosts_to_dictionary|dictsort|batch(dashboards_batch) %}
{% if vars.inital == 0 %}
{% if vars.update({'inital': (vars.inital + 1)}) %} {% endif %}
{% else %}
},
{% endif %}
{
"collapse": true,
"editable": true,
"height": "250px",
"panels": [
{% if group in groups %}
{% for host in groups[group] %}
{% for index, host in batched_hosts %}
{
"aliasColors": {},
"bars": false,
@@ -40,8 +46,8 @@
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
{% if panel_idx.update({'value': (panel_idx.value + 1)}) %} {% endif %}
"id": {{panel_idx.value}},
{% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %}
"id": {{vars.panel_idx}},
"isNew": true,
"legend": {
"alignAsTable": true,
@@ -114,19 +120,22 @@
"percent",
"short"
]
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% else %}
},
{% endif %}
{% endfor %}
],
{% if 'undercloud' in group %}
"title": "{{group}} CPU Usage",
{% else %}
"title": "{{group}} ({{batched_hosts[0][0]}} - {{batched_hosts[-1][0]}}) CPU Usage",
{% endif %}
"showTitle": true
{% endfor %}
{% endif %}
],
"title": "{{group}} CPU Usage",
"showTitle": true
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% endif %}
{% endfor %}

View File

@@ -1,5 +1,5 @@
{% set panel_idx = {'value': 0} %}
{% set osp_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{% set vars = {'panel_idx': 0, 'inital': 0, 'initial2': 0} %}
{% set dashboard_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{
"dashboard": {
"id": null,
@@ -13,14 +13,20 @@
"hideControls": false,
"sharedCrosshair": false,
"rows": [
{% for group in osp_groups %}
{% for group in dashboard_groups %}
{% if group in groups %}
{% for batched_hosts in groups[group]|hosts_to_dictionary|dictsort|batch(dashboards_batch) %}
{% if vars.inital == 0 %}
{% if vars.update({'inital': (vars.inital + 1)}) %} {% endif %}
{% else %}
},
{% endif %}
{
"collapse": true,
"editable": true,
"height": "250px",
"panels": [
{% if group in groups %}
{% for host in groups[group] %}
{% for index, host in batched_hosts %}
{
"aliasColors": {},
"bars": false,
@@ -40,8 +46,8 @@
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
{% if panel_idx.update({'value': (panel_idx.value + 1)}) %} {% endif %}
"id": {{panel_idx.value}},
{% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %}
"id": {{vars.panel_idx}},
"isNew": true,
"legend": {
"alignAsTable": true,
@@ -95,26 +101,39 @@
"iops",
"short"
]
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% else %}
},
{% endif %}
{% endfor %}
],
{% if 'undercloud' in group %}
"title": "{{group}} Disk iops",
{% else %}
"title": "{{group}} ({{batched_hosts[0][0]}} - {{batched_hosts[-1][0]}}) Disk iops",
{% endif %}
"showTitle": true
{% endfor %}
{% endif %}
],
"title": "{{group}} Disk iops",
"showTitle": true
{% if loop.last %}
},
{% endif %}
{% endfor %}
{% for group in osp_groups %}
{% for group in dashboard_groups %}
{% if group in groups %}
{% for batched_hosts in groups[group]|hosts_to_dictionary|dictsort|batch(dashboards_batch) %}
{% if vars.initial2 == 0 %}
{% if vars.update({'initial2': (vars.initial2 + 1)}) %} {% endif %}
{% else %}
},
{% endif %}
{
"collapse": true,
"editable": true,
"height": "250px",
"panels": [
{% if group in groups %}
{% for host in groups[group] %}
{% for index, host in batched_hosts %}
{
"aliasColors": {},
"bars": false,
@@ -134,8 +153,8 @@
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
{% if panel_idx.update({'value': (panel_idx.value + 1)}) %} {% endif %}
"id": {{panel_idx.value}},
{% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %}
"id": {{vars.panel_idx}},
"isNew": true,
"legend": {
"alignAsTable": true,
@@ -189,19 +208,22 @@
"Bps",
"short"
]
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% else %}
},
{% endif %}
{% endfor %}
],
{% if 'undercloud' in group %}
"title": "{{group}} Disk Throughput",
{% else %}
"title": "{{group}} ({{batched_hosts[0][0]}} - {{batched_hosts[-1][0]}}) Disk Throughput",
{% endif %}
"showTitle": true
{% endfor %}
{% endif %}
],
"title": "{{group}} Disk Throughput",
"showTitle": true
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% endif %}
{% endfor %}

View File

@@ -1,5 +1,5 @@
{% set panel_idx = {'value': 0} %}
{% set osp_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{% set vars = {'panel_idx': 0, 'inital': 0} %}
{% set dashboard_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{
"dashboard": {
"id": null,
@@ -13,14 +13,20 @@
"hideControls": false,
"sharedCrosshair": false,
"rows": [
{% for group in osp_groups %}
{% for group in dashboard_groups %}
{% if group in groups %}
{% for batched_hosts in groups[group]|hosts_to_dictionary|dictsort|batch(dashboards_batch) %}
{% if vars.inital == 0 %}
{% if vars.update({'inital': (vars.inital + 1)}) %} {% endif %}
{% else %}
},
{% endif %}
{
"collapse": true,
"editable": true,
"height": "250px",
"panels": [
{% if group in groups %}
{% for host in groups[group] %}
{% for index, host in batched_hosts %}
{
"aliasColors": {},
"bars": false,
@@ -40,8 +46,8 @@
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
{% if panel_idx.update({'value': (panel_idx.value + 1)}) %} {% endif %}
"id": {{panel_idx.value}},
{% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %}
"id": {{vars.panel_idx}},
"isNew": true,
"legend": {
"alignAsTable": true,
@@ -106,19 +112,22 @@
"bits",
"short"
]
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% else %}
},
{% endif %}
{% endfor %}
],
{% if 'undercloud' in group %}
"title": "{{group}} Memory Usage",
{% else %}
"title": "{{group}} ({{batched_hosts[0][0]}} - {{batched_hosts[-1][0]}}) Memory Usage",
{% endif %}
"showTitle": true
{% endfor %}
{% endif %}
],
"title": "{{group}} Memory Usage",
"showTitle": true
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% endif %}
{% endfor %}

View File

@@ -1,5 +1,5 @@
{% set panel_idx = {'value': 0} %}
{% set osp_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{% set vars = {'panel_idx': 0, 'inital': 0, 'initial2': 0} %}
{% set dashboard_groups = ['undercloud', 'controller', 'ceph', 'compute'] %}
{
"dashboard": {
"id": null,
@@ -13,14 +13,20 @@
"hideControls": false,
"sharedCrosshair": false,
"rows": [
{% for group in osp_groups %}
{% for group in dashboard_groups %}
{% if group in groups %}
{% for batched_hosts in groups[group]|hosts_to_dictionary|dictsort|batch(dashboards_batch) %}
{% if vars.inital == 0 %}
{% if vars.update({'inital': (vars.inital + 1)}) %} {% endif %}
{% else %}
},
{% endif %}
{
"collapse": true,
"editable": true,
"height": "250px",
"panels": [
{% if group in groups %}
{% for host in groups[group] %}
{% for index, host in batched_hosts %}
{
"aliasColors": {},
"bars": false,
@@ -40,8 +46,8 @@
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
{% if panel_idx.update({'value': (panel_idx.value + 1)}) %} {% endif %}
"id": {{panel_idx.value}},
{% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %}
"id": {{vars.panel_idx}},
"isNew": true,
"legend": {
"alignAsTable": true,
@@ -95,26 +101,39 @@
"pps",
"short"
]
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% else %}
},
{% endif %}
{% endfor %}
],
{% if 'undercloud' in group %}
"title": "{{group}} Network pps",
{% else %}
"title": "{{group}} ({{batched_hosts[0][0]}} - {{batched_hosts[-1][0]}}) Network pps",
{% endif %}
"showTitle": true
{% endfor %}
{% endif %}
],
"title": "{{group}} Network pps",
"showTitle": true
{% if loop.last %}
},
{% endif %}
{% endfor %}
{% for group in osp_groups %}
{% for group in dashboard_groups %}
{% if group in groups %}
{% for batched_hosts in groups[group]|hosts_to_dictionary|dictsort|batch(dashboards_batch) %}
{% if vars.initial2 == 0 %}
{% if vars.update({'initial2': (vars.initial2 + 1)}) %} {% endif %}
{% else %}
},
{% endif %}
{
"collapse": true,
"editable": true,
"height": "250px",
"panels": [
{% if group in groups %}
{% for host in groups[group] %}
{% for index, host in batched_hosts %}
{
"aliasColors": {},
"bars": false,
@@ -134,8 +153,8 @@
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
{% if panel_idx.update({'value': (panel_idx.value + 1)}) %} {% endif %}
"id": {{panel_idx.value}},
{% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %}
"id": {{vars.panel_idx}},
"isNew": true,
"legend": {
"alignAsTable": true,
@@ -189,19 +208,22 @@
"Bps",
"short"
]
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% else %}
},
{% endif %}
{% endfor %}
],
{% if 'undercloud' in group %}
"title": "{{group}} Disk Throughput",
{% else %}
"title": "{{group}} ({{batched_hosts[0][0]}} - {{batched_hosts[-1][0]}}) Network Throughput",
{% endif %}
"showTitle": true
{% endfor %}
{% endif %}
],
"title": "{{group}} Network Throughput",
"showTitle": true
{% if not loop.last %}
},
{% else %}
{% if loop.last %}
}
{% endif %}
{% endfor %}