Skip to content

Commit 616ffb3

Browse files
committed
Added --print-latencies option. Latencies in milliseconds are printed to stdout in a way that makes it easy to copy/paste into Python.
1 parent a84474b commit 616ffb3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

tests/testlatency/testlatency.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def main():
3939
parser.add_argument(
4040
"--all_latencies",
4141
action="store_true",
42-
help="Don't ignore initial latencies in the analysis.",
42+
help="Don't ignore initial and final latencies in the analysis.",
43+
)
44+
parser.add_argument(
45+
"--print-latencies",
46+
action="store_true",
47+
help="Print all receiver latencies"
4348
)
4449
parser.add_argument(
4550
"--seg_dur",
@@ -188,6 +193,12 @@ def main():
188193
analyser = Analyser(receiver_thread.statistics, sender_thread.statistics)
189194
results = analyser.analyse(not args.all_latencies)
190195
analyser.print(results)
196+
if args.print_latencies:
197+
print(f"testlatency: all_receiver_latencies = [")
198+
for rs in receiver_thread.statistics:
199+
latency = rs.receiver_wallclock - (rs.timestamp / 1000.0)
200+
print(f"\t{latency:.3f},")
201+
print(f"]")
191202
if ok and analyser.judge(results):
192203
print("testlatency: Latency test passed.")
193204
return 0

0 commit comments

Comments
 (0)