From cda8b7d2cd671698cb095dd769b29b838ee529b5 Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Thu, 19 Dec 2024 19:26:03 +0100 Subject: [PATCH] plot rendering time - first try --- plot-timing.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 plot-timing.sh diff --git a/plot-timing.sh b/plot-timing.sh new file mode 100755 index 0000000..d275746 --- /dev/null +++ b/plot-timing.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -ue + +TMPFILE="/dev/shm/plot-timing.tmp" +IMAGE="timing.png" + +tail -3600 WS/timing.mp4 | awk ' \ +BEGIN { \ + for (foo=0; foo<180; foo++) { \ + mini[foo] = 666; \ + maxi[foo] = -42; \ + } \ + maxidx = 0; \ + } \ + { \ + accu[$1] += $2; \ + count[$1]++; \ + if (mini[$1] > $2) mini[$1] = $2; \ + if (maxi[$1] < $2) maxi[$1] = $2; \ + last[$1] = $2; \ + maxidx = $1; \ + } \ +END { \ + for (foo=0; foo<180; foo++) { \ + mean = accu[foo] / count[foo]; \ + printf "%4d %4f %4d %4d %4d\n", foo, mean, \ + mini[foo], maxi[foo], last[foo]; \ + } \ + } \ +' > $TMPFILE + +gnuplot << __EOC__ + set term png size 800,480 + set output "timing.png" + set grid + set yrange [:200] + set title "HexaCone : temps de tracé vs. numéro de séquence" + set xlabel "numéro de la trame" + set ylabel "temps en secondes" + plot "/dev/shm/plot-timing.tmp" u 1:2 w l t "moyenne", \ + "/dev/shm/plot-timing.tmp" u 1:3 w l t "minimum", \ + "/dev/shm/plot-timing.tmp" u 1:4 w l t "maximum", \ + "/dev/shm/plot-timing.tmp" u 1:5 w l t "dernier" +__EOC__