monitoring: coloured SUMMARY block at end of run
Severity badges for OK/ERROR/WARN/INFO/BLOCKER counts plus verdict line (all clear / warnings only / failed).
This commit is contained in:
parent
6a6300f4ab
commit
e82ee9a70b
1 changed files with 48 additions and 13 deletions
|
|
@ -722,6 +722,7 @@ section() {
|
||||||
}
|
}
|
||||||
|
|
||||||
summary() {
|
summary() {
|
||||||
|
local blk_n=${#BLOCKERS[@]}
|
||||||
echo ""
|
echo ""
|
||||||
# final progress line (no _take_tid — plain printf)
|
# final progress line (no _take_tid — plain printf)
|
||||||
if [ "${PROGRESS_OFF:-0}" != "1" ] && [ "$PROGRESS_DONE" -gt 0 ]; then
|
if [ "${PROGRESS_OFF:-0}" != "1" ] && [ "$PROGRESS_DONE" -gt 0 ]; then
|
||||||
|
|
@ -733,37 +734,71 @@ summary() {
|
||||||
_progress_bar_line "$PROGRESS_DONE" "$PROGRESS_TOTAL"
|
_progress_bar_line "$PROGRESS_DONE" "$PROGRESS_TOTAL"
|
||||||
fi
|
fi
|
||||||
if [ "$GLOBAL_N" -gt 0 ]; then
|
if [ "$GLOBAL_N" -gt 0 ]; then
|
||||||
printf -- '%s numbered checks this run: #001…#%03d\n' "$D" "$GLOBAL_N"
|
printf -- '%s numbered checks this run: #001…#%03d%s\n' "$D" "$GLOBAL_N" "$N"
|
||||||
fi
|
fi
|
||||||
if [ "${#BLOCKERS[@]}" -gt 0 ]; then
|
if [ "$blk_n" -gt 0 ]; then
|
||||||
if [ "${BOX:-0}" = "1" ]; then
|
if [ "${BOX:-0}" = "1" ]; then
|
||||||
printf -- '%s┌ BLOCKERS · pay/withdraw cannot finish ┐%s\n' "$BG_BLK" "$N"
|
printf -- '%s┌ BLOCKERS · pay/withdraw cannot finish ┐%s\n' "$BG_BLK" "$N"
|
||||||
else
|
else
|
||||||
printf -- '--- BLOCKERS (pay/withdraw cannot finish) ---\n'
|
printf -- '%s--- BLOCKERS (pay/withdraw cannot finish) ---%s\n' "$M" "$N"
|
||||||
fi
|
fi
|
||||||
local b
|
local b
|
||||||
for b in "${BLOCKERS[@]}"; do
|
for b in "${BLOCKERS[@]}"; do
|
||||||
printf -- '%s •%s %s%s%s\n' "$M" "$N" "$W" "$b" "$N"
|
printf -- ' %s•%s %s%s%s\n' "$M" "$N" "$W" "$b" "$N"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ "${#ERRORS[@]}" -gt 0 ] && [ "${#BLOCKERS[@]}" -lt "${#ERRORS[@]}" ]; then
|
if [ "${#ERRORS[@]}" -gt 0 ] && [ "$blk_n" -lt "${#ERRORS[@]}" ]; then
|
||||||
if [ "${BOX:-0}" = "1" ]; then
|
if [ "${BOX:-0}" = "1" ]; then
|
||||||
printf -- '%s┌ ERRORS · failed checks ┐%s\n' "$BG_ERR" "$N"
|
printf -- '%s┌ ERRORS · failed checks ┐%s\n' "$BG_ERR" "$N"
|
||||||
else
|
else
|
||||||
printf -- '--- ERRORS (failed checks) ---\n'
|
printf -- '%s--- ERRORS (failed checks) ---%s\n' "$R" "$N"
|
||||||
fi
|
fi
|
||||||
local e
|
local e
|
||||||
for e in "${ERRORS[@]}"; do
|
for e in "${ERRORS[@]}"; do
|
||||||
case "$e" in BLOCKER*) continue ;; esac
|
case "$e" in BLOCKER*) continue ;; esac
|
||||||
printf -- '%s •%s %s%s%s\n' "$R" "$N" "$W" "$e" "$N"
|
printf -- ' %s•%s %s%s%s\n' "$R" "$N" "$W" "$e" "$N"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
printf -- '%stotals:%s %s%d OK%s' "$D" "$N" "$G" "$PASS_N" "$N"
|
|
||||||
[ "$FAIL_N" -gt 0 ] && printf -- ', %s%d ERROR%s' "$R" "$FAIL_N" "$N"
|
# Coloured totals — same severity badges as check lines
|
||||||
[ "$WARN_N" -gt 0 ] && printf -- ', %s%d WARN%s' "$Y" "$WARN_N" "$N"
|
if [ "${BOX:-0}" = "1" ]; then
|
||||||
[ "$INFO_N" -gt 0 ] && printf -- ', %s%d INFO%s' "$C" "$INFO_N" "$N"
|
printf -- '\n%s┌ SUMMARY ┐%s\n' "$BG_SEC" "$N"
|
||||||
[ "${#BLOCKERS[@]}" -gt 0 ] && printf -- ', %s%d BLOCKER%s' "$M" "${#BLOCKERS[@]}" "$N"
|
printf -- ' %s┌ OK ┐%s %s%4d%s\n' "$BG_OK" "$N" "$G" "$PASS_N" "$N"
|
||||||
printf '\n'
|
if [ "$FAIL_N" -gt 0 ]; then
|
||||||
|
printf -- ' %s┌ ERROR ┐%s %s%4d%s\n' "$BG_ERR" "$N" "$R" "$FAIL_N" "$N"
|
||||||
|
fi
|
||||||
|
if [ "$WARN_N" -gt 0 ]; then
|
||||||
|
printf -- ' %s┌ WARN ┐%s %s%4d%s\n' "$BG_WARN" "$N" "$Y" "$WARN_N" "$N"
|
||||||
|
fi
|
||||||
|
if [ "$INFO_N" -gt 0 ]; then
|
||||||
|
printf -- ' %s┌ INFO ┐%s %s%4d%s\n' "$BG_INFO" "$N" "$C" "$INFO_N" "$N"
|
||||||
|
fi
|
||||||
|
if [ "$blk_n" -gt 0 ]; then
|
||||||
|
printf -- ' %s┌ BLOCK ┐%s %s%4d%s\n' "$BG_BLK" "$N" "$M" "$blk_n" "$N"
|
||||||
|
fi
|
||||||
|
# one-line rollup (bold counts)
|
||||||
|
printf -- ' %s%s totals:%s %s%d OK%s' "$B" "$D" "$N" "$G" "$PASS_N" "$N"
|
||||||
|
[ "$FAIL_N" -gt 0 ] && printf -- ' · %s%d ERROR%s' "$R" "$FAIL_N" "$N"
|
||||||
|
[ "$WARN_N" -gt 0 ] && printf -- ' · %s%d WARN%s' "$Y" "$WARN_N" "$N"
|
||||||
|
[ "$INFO_N" -gt 0 ] && printf -- ' · %s%d INFO%s' "$C" "$INFO_N" "$N"
|
||||||
|
[ "$blk_n" -gt 0 ] && printf -- ' · %s%d BLOCKER%s' "$M" "$blk_n" "$N"
|
||||||
|
printf '\n'
|
||||||
|
# overall verdict
|
||||||
|
if [ "$FAIL_N" -eq 0 ] && [ "$blk_n" -eq 0 ] && [ "$WARN_N" -eq 0 ]; then
|
||||||
|
printf -- ' %s┌ OK ┐%s %sall clear%s\n' "$BG_OK" "$N" "$G" "$N"
|
||||||
|
elif [ "$FAIL_N" -eq 0 ] && [ "$blk_n" -eq 0 ]; then
|
||||||
|
printf -- ' %s┌ WARN ┐%s %swarnings only (no hard fail)%s\n' "$BG_WARN" "$N" "$Y" "$N"
|
||||||
|
else
|
||||||
|
printf -- ' %s┌ ERROR ┐%s %sfailed — see list above%s\n' "$BG_ERR" "$N" "$R" "$N"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
printf -- 'totals: %s%d OK%s' "$G" "$PASS_N" "$N"
|
||||||
|
[ "$FAIL_N" -gt 0 ] && printf -- ', %s%d ERROR%s' "$R" "$FAIL_N" "$N"
|
||||||
|
[ "$WARN_N" -gt 0 ] && printf -- ', %s%d WARN%s' "$Y" "$WARN_N" "$N"
|
||||||
|
[ "$INFO_N" -gt 0 ] && printf -- ', %s%d INFO%s' "$C" "$INFO_N" "$N"
|
||||||
|
[ "$blk_n" -gt 0 ] && printf -- ', %s%d BLOCKER%s' "$M" "$blk_n" "$N"
|
||||||
|
printf '\n'
|
||||||
|
fi
|
||||||
[ "$FAIL_N" -eq 0 ]
|
[ "$FAIL_N" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue