aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-10-17 05:03:58 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-10-17 05:03:58 +0200
commit553d71c677b8f1ac995723dee0a4f214e828e8d2 (patch)
treea93eb83a0aa9bc3a2db25a5e3cd0c55bae30eef6
parent8f267e2943d6e64f38e41a6ac55792f1c4b3c745 (diff)
downloaddabmux-553d71c677b8f1ac995723dee0a4f214e828e8d2.tar.gz
dabmux-553d71c677b8f1ac995723dee0a4f214e828e8d2.tar.bz2
dabmux-553d71c677b8f1ac995723dee0a4f214e828e8d2.zip
munin stats: Output multigraph line for state
-rwxr-xr-xdoc/stats_dabmux_multi.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/stats_dabmux_multi.py b/doc/stats_dabmux_multi.py
index 027959a..d97b5e9 100755
--- a/doc/stats_dabmux_multi.py
+++ b/doc/stats_dabmux_multi.py
@@ -119,13 +119,15 @@ if len(sys.argv) == 1:
munin_values = ""
for ident in values:
v = values[ident]['inputstat']
- munin_values += "multigraph buffers_{ident}\n".format(ident=ident.replace('-', '_'))
+
+ ident_ = ident.replace('-', '_')
+ munin_values += "multigraph buffers_{ident}\n".format(ident=ident_)
munin_values += "high.value {}\n".format(v['max_fill'])
munin_values += "low.value {}\n".format(v['min_fill'])
- munin_values += "multigraph over_underruns_{ident}\n".format(ident=ident.replace('-', '_'))
+ munin_values += "multigraph over_underruns_{ident}\n".format(ident=ident_)
munin_values += "underruns.value {}\n".format(v['num_underruns'])
munin_values += "overruns.value {}\n".format(v['num_overruns'])
- munin_values += "multigraph audio_levels_{ident}\n".format(ident=ident.replace('-', '_'))
+ munin_values += "multigraph audio_levels_{ident}\n".format(ident=ident_)
munin_values += "left.value {}\n".format(v['peak_left'])
munin_values += "right.value {}\n".format(v['peak_right'])
@@ -133,6 +135,7 @@ if len(sys.argv) == 1:
# If ODR-DabMux is v1.3.1-3 or older, it doesn't export state
match = re_state.match(v['state'])
if match:
+ munin_values += "multigraph state_{ident}\n".format(ident=ident_)
munin_values += "state.value {}\n".format(match.group(1))
else:
print("Cannot parse state '{}'".format(v['state']))