Commit 4abe982
authored
fix(ui): handle missing block log metrics gracefully (#168)
## Summary
- Make `timing`, `throughput`, `state_reads`, `state_writes`, and
`cache` optional on `BlockLogEntry` type
- **BlockLogDetails**: conditionally render timing breakdown, overhead
pie, cache chart, and state ops sections only when their data exists.
Metric cards show "N/A" instead of misleading zeros
- **BlockLogsComparison / TestComparisonTable / useProcessedData**: use
optional chaining (`?.`) with `?? 0` fallbacks for safe metric
extraction
## Test plan
- [x] View a run with complete block log data — all sections render as
before
- [x] View a run with partial block log data (e.g. missing
`state_read_ms`) — missing metrics show "N/A", sections without data are
hidden
- [x] Compare page still works with partial block log data
- [x] Block logs dashboard table/charts handle partial data without
crashes1 parent 8065a48 commit 4abe982
5 files changed
Lines changed: 256 additions & 208 deletions
File tree
- ui/src
- api
- components
- compare
- run-detail
- block-logs-dashboard/hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments