aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
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()