tests: make lttng_live_server.py print session URLs
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 18 Sep 2023 18:18:54 +0000 (14:18 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 20 Oct 2023 23:29:14 +0000 (19:29 -0400)
To help with interactive use, make lttng_live_server.py print session
URLs that you can pass directly to babeltrace.

For instance:

    $ PYTHONPATH=/home/smarchi/src/babeltrace/tests/utils/python /opt/python/3.4.10/bin/python3 lttng_live_server.py --trace-path-prefix /home/smarchi/src/babeltrace/tests/data/ctf-traces  split_metadata.json --port 1245
    Listening on port 1245
    net://localhost:1245/host/hostname/split_metadata

Change-Id: Ib4d806804bfdc00132ec7987c62016ad976b50d2
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10900
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py

index 5e1e8e69ed839a9f9c0a9e1c572e6bc76f8f9e0a..5d8440292e28a2720dde6cc66dd2ffa6051dec4b 100644 (file)
@@ -1668,6 +1668,14 @@ class LttngLiveServer:
 
         print("Listening on port {}".format(self._server_port))
 
+        for ts_descr in tracing_session_descriptors:
+            info = ts_descr.info
+            print(
+                "net://localhost:{}/host/{}/{}".format(
+                    self._server_port, info.hostname, info.name
+                )
+            )
+
         try:
             self._listen()
         finally:
This page took 0.02587 seconds and 4 git commands to generate.