Commit 0cb7d29
authored
feat: Add observability metrics for scan log replay (delta-io#1866)
Adds observability metrics to scan log replay for tracking performance
and
debugging parallel checkpoint processing.
Key changes:
ScanMetrics struct with atomic counters:
- num_add_files_seen - add files seen during deduplication
- num_active_add_files - add files that survived log replay (files to
read)
- num_remove_files_seen - remove files seen from delta/commit files
- num_non_file_actions - protocol, metadata, etc.
- num_predicate_filtered - files filtered by data skipping or partition
pruning
- hash_set_size - peak size of deduplication hash set
- dedup_visitor_time_ns - time spent in deduplication visitor
- predicate_eval_time_ns - time spent evaluating predicates
Other changes:
- Metrics logged at phase boundaries with log_with_message()
- Counters reset between sequential and parallel phases
- Uses relaxed atomic ordering for performance across parallel threads
```
INFO Completed sequential scan metadata num_adds=0 num_removes=0 num_non_file_actions=5 hash_set_size=0 data_skipping_filtered=0 partition_pruning_filtered=0
dedup_visitor_time_ms=0 data_skipping_time_ms=0 partition_pruning_time_ms=0
INFO Completed parallel scan metadata num_adds=101 num_removes=0 num_non_file_actions=0 hash_set_size=101 data_skipping_filtered=4 partition_pruning_filtered=0
dedup_visitor_time_ms=2 data_skipping_time_ms=15 partition_pruning_time_ms=0
```
# Testing
Added parameterized tests with `ExpectedMetrics` struct verifying exact
counter values across 4 scenarios:
* JSON-only checkpoint (no sidecars
* Parquet sidecars
* with/without predicates
* With/without parallel phase1 parent f6b5821 commit 0cb7d29
8 files changed
Lines changed: 671 additions & 78 deletions
File tree
- kernel/src
- actions
- parallel
- scan
- table_changes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
695 | 699 | | |
696 | 700 | | |
697 | 701 | | |
698 | | - | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
699 | 706 | | |
700 | 707 | | |
701 | 708 | | |
| |||
1299 | 1306 | | |
1300 | 1307 | | |
1301 | 1308 | | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1302 | 1334 | | |
0 commit comments