aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2025-03-11 16:35:08 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2025-03-11 16:36:06 +0100
commit6517cc3078eba96ea96e085d033a4b8a96eb7151 (patch)
tree6a8d2aee0cf00cd76263bfdca58da6a934547b40 /doc
parent84a7a40492b3db9f204f48262481e60a1268f469 (diff)
downloaddabmux-6517cc3078eba96ea96e085d033a4b8a96eb7151.tar.gz
dabmux-6517cc3078eba96ea96e085d033a4b8a96eb7151.tar.bz2
dabmux-6517cc3078eba96ea96e085d033a4b8a96eb7151.zip
Add EDI/TCP number of active connections statisticsnext
Diffstat (limited to 'doc')
-rw-r--r--doc/STATS.md7
-rwxr-xr-xdoc/show_dabmux_stats.py22
2 files changed, 26 insertions, 3 deletions
diff --git a/doc/STATS.md b/doc/STATS.md
index 385d41e..435a92e 100644
--- a/doc/STATS.md
+++ b/doc/STATS.md
@@ -4,12 +4,13 @@ Stats available through Management Server
Interface
---------
-The management server makes statistics about the inputs available through a ZMQ request/reply socket.
+The management server makes statistics about the inputs and EDI/TCP outputs
+available through a ZMQ request/reply socket.
The `show_dabmux_stats.py` illustrates how to access this information.
-Meaning of values
------------------
+Meaning of values for inputs
+----------------------------
`max` and `min` indicate input buffer fullness in bytes.
diff --git a/doc/show_dabmux_stats.py b/doc/show_dabmux_stats.py
index 7ea60f7..3b6d869 100755
--- a/doc/show_dabmux_stats.py
+++ b/doc/show_dabmux_stats.py
@@ -46,6 +46,7 @@ if len(sys.argv) == 1:
data = sock.recv().decode("utf-8")
values = json.loads(data)['values']
+ print("## INPUT STATS")
tmpl = "{ident:20}{maxfill:>8}{minfill:>8}{under:>8}{over:>8}{audioleft:>8}{audioright:>8}{peakleft:>8}{peakright:>8}{state:>16}{version:>48}{uptime:>8}{offset:>8}"
print(tmpl.format(
ident="id",
@@ -89,6 +90,27 @@ if len(sys.argv) == 1:
uptime=v['uptime'],
offset=v['last_tist_offset']))
+ sock.send(b"output_values")
+
+ poller = zmq.Poller()
+ poller.register(sock, zmq.POLLIN)
+
+ socks = dict(poller.poll(1000))
+ if socks:
+ if socks.get(sock) == zmq.POLLIN:
+ print()
+ print("## OUTPUT STATS")
+ data = sock.recv().decode("utf-8")
+ values = json.loads(data)['output_values']
+ for identifier in values:
+ if identifier.startswith("edi_tcp_"):
+ listen_port = identifier.rsplit("_", 1)[-1]
+ num_connections = values[identifier]["num_connections"]
+ print(f"EDI TCP on port {listen_port}: {num_connections} connections")
+ else:
+ print(f"Unknown output type: {identifier}")
+
+
elif len(sys.argv) == 2 and sys.argv[1] == "config":
sock = connect()