tracers: buffer-lateness: display some stats about late buffers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1437>
This commit is contained in:
Guillaume Desmottes 2024-01-23 11:00:34 +01:00 committed by GStreamer Marge Bot
parent d5740ea844
commit 33a1d8de3d

View file

@ -1,6 +1,7 @@
import argparse
import csv
import re
import statistics
import matplotlib
import matplotlib.pyplot as plt
@ -73,6 +74,16 @@ for (i, (pad, values)) in enumerate(pads.items()):
color = colors[i],
)
late = [x[1] for x in values['lateness'] if x[2]]
n_late = len(late)
n_buffers = len(values['lateness'])
print("{} late buffers: {}/{} ratio: {:.2f}% min: {} max: {} mean: {}".format(
pad, n_late, n_buffers, (n_late / n_buffers) * 100,
min(late) if n_late > 0 else "",
max(late) if n_late > 0 else "",
statistics.mean(late) if n_late > 0 else ""))
if not args.no_latency:
ax1.plot(
[x[0] for x in values['latency']],