Commit 79e98c2
committed
Surface unhealthy-age rollup on dw system:operator-metrics
Renders the workflow-v2 unhealthy-age rollup pinned by the Phase 6
rollout-safety contract on `operator_metrics.tasks.oldest_unhealthy_at`
and `operator_metrics.tasks.max_unhealthy_age_ms` so HTTP-only
operators can read the worst-case duplicate-risk task age (the
earliest of `oldest_dispatch_failed_at`, `oldest_claim_failed_at`,
`oldest_dispatch_overdue_since`, `oldest_lease_expired_at` and the
largest age in milliseconds across them) directly from
`dw system:operator-metrics` without taking a max over four separate
per-path age fields themselves.
`OperatorMetricsCommand::renderTasks()` now emits two new rows right
after the existing "Unhealthy (duplicate-risk roll-up)" summary line
and before the per-path age detail rows:
Oldest unhealthy age: <ms> ms
Oldest unhealthy at: <ISO>
Both rows degrade gracefully when the snapshot predates the contract:
the renderer omits each row when its key is absent and the existing
per-path age rendering still surfaces individual lease, ready-due,
dispatch-overdue, claim-failed, and dispatch-failed ages.
Pins `tasks.oldest_unhealthy_at` and `tasks.max_unhealthy_age_ms` on
`schemas/output/operator-metrics.schema.json` next to the existing
unhealthy/per-path age keys, and adds
`test_operator_metrics_schema_pins_unhealthy_age_keys` and
`test_operator_metrics_command_omits_unhealthy_age_when_snapshot_predates_contract`
plus assertions on the existing render smoke test to guard the
schema declaration, the renderer, and the renderer fallback.1 parent 9c557ee commit 79e98c2
3 files changed
Lines changed: 54 additions & 1 deletion
File tree
- schemas/output
- src/Commands/SystemCommand
- tests/Commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
519 | 521 | | |
520 | 522 | | |
521 | 523 | | |
| |||
701 | 703 | | |
702 | 704 | | |
703 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
704 | 744 | | |
705 | 745 | | |
706 | 746 | | |
| |||
982 | 1022 | | |
983 | 1023 | | |
984 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
985 | 1027 | | |
986 | 1028 | | |
987 | 1029 | | |
| |||
0 commit comments