Operational Status Reports
Service Health
Summarize Check Counts
A Bash status report can turn a small check count into a clear ready or blocked line without calling external services.
Program
Play the script to choose the failed check count and inspect the service health report.
service_health_report.sh
Replay: real traced execution (multi-file project)
#!/usr/bin/env bash
failed_checks=1
max_allowed=0
if (( failed_checks <= max_allowed )); then
status="ready"
else
status="blocked"
fi
echo "service=api failed=$failed_checks status=$status"
#!/usr/bin/env bash
failed_checks=0
max_allowed=0
if (( failed_checks <= max_allowed )); then
status="ready"
else
status="blocked"
fi
echo "service=api failed=$failed_checks status=$status"
failed_checks ← 1
3failed_checks=14max_allowed=0values this step1failed_checksmax_allowed ← 0
3failed_checks=14max_allowed=05if (( failed_checks <= max_allowed )); thenvalues this step0max_allowedif (( failed_checks <= max_allowed )); then
4max_allowed=05if (( failed_checks <= max_allowed )); then6 status="ready"values this step1failed_checks0max_allowedstatus ← blocked
7else8 status="blocked"9fivalues this stepblockedstatusecho "service=api failed=$failed_checks status=$status"
9fi10echo "service=api failed=$failed_checks status=$status"outputservice=api failed=1 status=blockedvalues this step1failed_checksblockedstatus
failed_checks ← 0
3failed_checks=04max_allowed=0values this step0failed_checksmax_allowed ← 0
3failed_checks=04max_allowed=05if (( failed_checks <= max_allowed )); thenvalues this step0max_allowedif (( failed_checks <= max_allowed )); then
4max_allowed=05if (( failed_checks <= max_allowed )); then6 status="ready"values this step0failed_checks0max_allowedstatus ← ready
5if (( failed_checks <= max_allowed )); then6 status="ready"7elsevalues this stepreadystatusecho "service=api failed=$failed_checks status=$status"
9fi10echo "service=api failed=$failed_checks status=$status"outputservice=api failed=0 status=readyvalues this step0failed_checksreadystatus
check count
The script keeps the service signal as one numeric count.
status branch
The threshold branch converts the count into a ready or blocked label.
report line
The final echo emits a stable status line that another tool could parse.