Brainrot_Muxa/docker/check_all.sh

23 lines
1.6 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Все записи подряд: для каждой — узел, проигрывание и строка сводки.
#
# docker run --rm --network host --ipc host -v <бэги>:/data:ro \
# -v <репо>/docker:/smoke:ro flyguard bash /smoke/check_all.sh
#
# Узел поднимается заново на каждую запись: это разные проезды, и состояние
# одного (треки, ось пути) не должно перетекать в другой. «Кадров с тревогой»
# на записи без препятствия — это ложные тревоги.
set -u
here="$(dirname "$0")"
printf '%-38s %8s %9s %22s %26s\n' "запись" "принято" "обработ." "кадров с тревогой" "кадр: медиана / p95, мс"
for bag in /data/*/; do
[ -f "$bag/metadata.yaml" ] || continue
name=$(basename "$bag")
out=$(bash "$here/demo_test.sh" "$bag" 2>&1)
recv=$(echo "$out" | grep -o "frames_received=[0-9]*" | cut -d= -f2)
proc=$(echo "$out" | grep -o "frames_processed=[0-9]*" | cut -d= -f2)
hits=$(echo "$out" | grep -o "кадров с обнаружением: [0-9]* ([0-9.]*%)" | sed 's/кадров с обнаружением: //')
ms=$(echo "$out" | grep -o "медиана [0-9.]* мс, p95 [0-9.]*" | sed 's/медиана //; s/ мс, p95 / \/ /')
first=$(echo "$out" | grep -o "ПРЕПЯТСТВИЕ: [0-9.]* м" | head -1)
printf '%-38s %8s %9s %22s %26s %s\n' "$name" "${recv:--}" "${proc:--}" "${hits:-0}" "${ms:--}" "$first"
done