From ddd01758183296b65330f1b169f4fdf4b99ad0f8 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Mon, 5 Jul 2021 01:13:20 +0200 Subject: [PATCH] wip --- bundles/grafana/items.py | 2 +- data/grafana/rows/mem.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bundles/grafana/items.py b/bundles/grafana/items.py index 8917d9d..3f41725 100644 --- a/bundles/grafana/items.py +++ b/bundles/grafana/items.py @@ -104,7 +104,7 @@ for dashboard_id, monitored_node in enumerate(monitored_nodes, start=1): for panel_in_row, (panel_name, panel_config) in enumerate(row.items()): panel = deepcopy(panel_template) panel['id'] = next(panel_id) - panel['title'] = panel_name + panel['title'] = f'{row_name} {panel_name}' panel['gridPos']['w'] = 24 // len(row) panel['gridPos']['x'] = (24 // len(row)) * panel_in_row panel['gridPos']['y'] = (row_id - 1) * panel['gridPos']['h'] diff --git a/data/grafana/rows/mem.py b/data/grafana/rows/mem.py index 4242f9f..1fcaf57 100644 --- a/data/grafana/rows/mem.py +++ b/data/grafana/rows/mem.py @@ -17,4 +17,20 @@ }, 'unit': 'decbytes', }, + 'swp': { + 'stacked': True, + 'queries': { + 'memory': { + 'filters': { + '_measurement': 'mem', + '_field': [ + 'swap_cached', + 'swap_free', + ], + }, + 'function': 'mean', + }, + }, + 'unit': 'decbytes', + }, }