Commit 16b49a0
committed
Transfer: Honest ETA when files outnumber bytes
- New `EtaEstimator` in `write_operations/eta.rs` tracks bytes/s and files/s independently with time-weighted EWMA (τ ≈ 3 s) and combines via `max(ETA_bytes, ETA_files)`. The operation can't finish before either axis is done, so the larger remaining time is reality.
- Fixes the small-file-tail bug: deleting 5 GB / 174k files showed `~0 s remaining` for 20 s once the size bar saturated. ETA now tracks whichever axis still has work.
- `WriteProgressEvent` gains `bytesPerSecond`, `filesPerSecond`, `etaSeconds` — populated by `WriteOperationState::enrich_progress` at every emit site (local copy/delete/trash/scan/move + volume copy/move). One estimator per operation, lives in state.
- Pure EWMA, no overall-average anchor — adapts to network changes within ~3τ instead of being pulled toward historical numbers. Warm-up gate (≥ 2 samples AND ≥ 800 ms) kills early-readout flicker.
- `TransferProgressDialog` ripped out its blended-speed math; renders both speeds side by side ("27.7 MB/s · 1,234 files/s"). 25%/tick display low-pass on ETA prevents flicker without dampening real changes.
- 10 unit tests covering byte-heavy, file-heavy, big-then-small-tail pathology, mid-op slowdown convergence, brief stall + resume, phase transitions, and rollback. All write_operations tests (161) still green.1 parent 3c12ff2 commit 16b49a0
17 files changed
Lines changed: 953 additions & 239 deletions
File tree
- apps/desktop
- src-tauri/src/file_system
- volume
- write_operations
- src/lib
- file-explorer
- file-operations/transfer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3502 | 3502 | | |
3503 | 3503 | | |
3504 | 3504 | | |
3505 | | - | |
3506 | 3505 | | |
3507 | 3506 | | |
3508 | 3507 | | |
| |||
3564 | 3563 | | |
3565 | 3564 | | |
3566 | 3565 | | |
3567 | | - | |
3568 | | - | |
3569 | | - | |
3570 | | - | |
3571 | | - | |
| 3566 | + | |
3572 | 3567 | | |
3573 | 3568 | | |
3574 | 3569 | | |
| |||
3777 | 3772 | | |
3778 | 3773 | | |
3779 | 3774 | | |
3780 | | - | |
3781 | 3775 | | |
3782 | 3776 | | |
3783 | 3777 | | |
| |||
3889 | 3883 | | |
3890 | 3884 | | |
3891 | 3885 | | |
3892 | | - | |
3893 | | - | |
3894 | | - | |
3895 | | - | |
3896 | | - | |
| 3886 | + | |
3897 | 3887 | | |
3898 | 3888 | | |
3899 | 3889 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
61 | 80 | | |
62 | 81 | | |
63 | 82 | | |
| |||
Lines changed: 30 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
| 159 | + | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
365 | 369 | | |
366 | 370 | | |
367 | 371 | | |
368 | | - | |
369 | | - | |
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
| |||
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
623 | | - | |
624 | | - | |
| 625 | + | |
| 626 | + | |
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
| |||
631 | 633 | | |
632 | 634 | | |
633 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
634 | 640 | | |
635 | 641 | | |
636 | 642 | | |
| |||
669 | 675 | | |
670 | 676 | | |
671 | 677 | | |
672 | | - | |
673 | | - | |
| 678 | + | |
| 679 | + | |
674 | 680 | | |
675 | 681 | | |
676 | 682 | | |
| |||
680 | 686 | | |
681 | 687 | | |
682 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
683 | 693 | | |
684 | 694 | | |
685 | 695 | | |
| |||
727 | 737 | | |
728 | 738 | | |
729 | 739 | | |
730 | | - | |
731 | | - | |
732 | 740 | | |
733 | 741 | | |
734 | 742 | | |
735 | 743 | | |
736 | 744 | | |
737 | | - | |
738 | | - | |
| 745 | + | |
| 746 | + | |
739 | 747 | | |
740 | 748 | | |
741 | 749 | | |
| |||
745 | 753 | | |
746 | 754 | | |
747 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
748 | 760 | | |
749 | 761 | | |
750 | 762 | | |
| |||
788 | 800 | | |
789 | 801 | | |
790 | 802 | | |
791 | | - | |
792 | | - | |
| 803 | + | |
| 804 | + | |
793 | 805 | | |
794 | 806 | | |
795 | 807 | | |
| |||
799 | 811 | | |
800 | 812 | | |
801 | 813 | | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
802 | 818 | | |
803 | 819 | | |
804 | 820 | | |
| |||
Lines changed: 24 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
194 | 198 | | |
195 | 199 | | |
196 | 200 | | |
197 | | - | |
198 | | - | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| |||
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
264 | | - | |
265 | | - | |
| 266 | + | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| |||
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| |||
344 | 350 | | |
345 | 351 | | |
346 | 352 | | |
347 | | - | |
348 | | - | |
| 353 | + | |
| 354 | + | |
349 | 355 | | |
350 | 356 | | |
351 | 357 | | |
| |||
355 | 361 | | |
356 | 362 | | |
357 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
358 | 368 | | |
359 | 369 | | |
360 | 370 | | |
| |||
408 | 418 | | |
409 | 419 | | |
410 | 420 | | |
411 | | - | |
412 | | - | |
| 421 | + | |
| 422 | + | |
413 | 423 | | |
414 | 424 | | |
415 | 425 | | |
| |||
419 | 429 | | |
420 | 430 | | |
421 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
422 | 436 | | |
423 | 437 | | |
424 | 438 | | |
| |||
0 commit comments