Skip to content

Commit

Permalink
declutter Node Util panel
Browse files Browse the repository at this point in the history
  • Loading branch information
hector-baez committed Nov 8, 2023
1 parent ee1a2af commit bcf03cc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions grafana/main/ben-dashboard-mod.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import json
import ast
import argparse
import requests
import urllib.request
import copy
import re

""""
Modifies panel relating to Ben Job Scheduler.
Expand Down Expand Up @@ -46,7 +45,13 @@ def fetch_metrics():
for line in metrics.split("\n"):
if line == "" or line.startswith('#') or line.startswith("ben"):
continue
nodes.append(line.split()[0])
match = re.match(r'([^0-9]+)\d*_ben_([^_]+)_', line.split()[0])
# example: newick01_ben_tronko_size
# group 1: first word (i.e newick)
# group 2: word after ben (i.e tronko)
if match:
if match.group(1) == match.group(2):
nodes.append(line.split()[0])
print(nodes)

for panel in dashboard["panels"]:
Expand Down

0 comments on commit bcf03cc

Please sign in to comment.