progress: expose bytes_retryable so 'lost' counts only failed reads
Add PassProgress::bytes_retryable_total (NonTrimmed/NonScraped — failed and awaiting retry), distinct from bytes_pending_total which also folds in not-yet-attempted (NonTried) bytes. Set it at every construction site (Sweep from the snapshot, Patch from stats, 0 for sequential/placeholder paths). The disc-level 'lost' display in the CLI can now use unreadable+retryable instead of unreadable+pending, so a healthy in-progress rip no longer reports its unread remainder as lost.
This commit is contained in:
@@ -613,6 +613,7 @@ fn report(opts: &ExtractOptions, done: u64, total: u64) -> bool {
|
|||||||
bytes_good_total: done,
|
bytes_good_total: done,
|
||||||
bytes_unreadable_total: 0,
|
bytes_unreadable_total: 0,
|
||||||
bytes_pending_total: 0,
|
bytes_pending_total: 0,
|
||||||
|
bytes_retryable_total: 0,
|
||||||
bytes_total_disc: total,
|
bytes_total_disc: total,
|
||||||
disc_duration_secs: None,
|
disc_duration_secs: None,
|
||||||
bytes_bad_in_main_title: 0,
|
bytes_bad_in_main_title: 0,
|
||||||
|
|||||||
+10
-2
@@ -3180,13 +3180,20 @@ impl Disc {
|
|||||||
// already sent — Anomaly B in the 0.18.1 prod test was
|
// already sent — Anomaly B in the 0.18.1 prod test was
|
||||||
// this regression: a stale early snapshot pinned the
|
// this regression: a stale early snapshot pinned the
|
||||||
// display to 0 GB while bytes_done was already advancing.
|
// display to 0 GB while bytes_done was already advancing.
|
||||||
let (bytes_good, bytes_unreadable, bytes_pending) = match &cached_snapshot {
|
let (bytes_good, bytes_unreadable, bytes_pending, bytes_retryable) =
|
||||||
|
match &cached_snapshot {
|
||||||
Some(snap) => (
|
Some(snap) => (
|
||||||
snap.stats.bytes_good.max(bytes_done),
|
snap.stats.bytes_good.max(bytes_done),
|
||||||
snap.stats.bytes_unreadable,
|
snap.stats.bytes_unreadable,
|
||||||
snap.stats.bytes_pending,
|
snap.stats.bytes_pending,
|
||||||
|
snap.stats.bytes_retryable,
|
||||||
|
),
|
||||||
|
None => (
|
||||||
|
bytes_done,
|
||||||
|
0u64,
|
||||||
|
total_bytes.saturating_sub(bytes_done),
|
||||||
|
0u64,
|
||||||
),
|
),
|
||||||
None => (bytes_done, 0u64, total_bytes.saturating_sub(bytes_done)),
|
|
||||||
};
|
};
|
||||||
let pp = crate::progress::PassProgress {
|
let pp = crate::progress::PassProgress {
|
||||||
kind: crate::progress::PassKind::Sweep,
|
kind: crate::progress::PassKind::Sweep,
|
||||||
@@ -3195,6 +3202,7 @@ impl Disc {
|
|||||||
bytes_good_total: bytes_good,
|
bytes_good_total: bytes_good,
|
||||||
bytes_unreadable_total: bytes_unreadable,
|
bytes_unreadable_total: bytes_unreadable,
|
||||||
bytes_pending_total: bytes_pending,
|
bytes_pending_total: bytes_pending,
|
||||||
|
bytes_retryable_total: bytes_retryable,
|
||||||
bytes_total_disc: total_bytes,
|
bytes_total_disc: total_bytes,
|
||||||
disc_duration_secs: main_title.map(|t| t.duration_secs),
|
disc_duration_secs: main_title.map(|t| t.duration_secs),
|
||||||
bytes_bad_in_main_title: main_title_bad,
|
bytes_bad_in_main_title: main_title_bad,
|
||||||
|
|||||||
@@ -1629,6 +1629,7 @@ impl Disc {
|
|||||||
bytes_good_total: s.bytes_good,
|
bytes_good_total: s.bytes_good,
|
||||||
bytes_unreadable_total: s.bytes_unreadable,
|
bytes_unreadable_total: s.bytes_unreadable,
|
||||||
bytes_pending_total: s.bytes_pending,
|
bytes_pending_total: s.bytes_pending,
|
||||||
|
bytes_retryable_total: s.bytes_retryable,
|
||||||
bytes_total_disc: total_bytes,
|
bytes_total_disc: total_bytes,
|
||||||
disc_duration_secs: main_title.map(|t| t.duration_secs),
|
disc_duration_secs: main_title.map(|t| t.duration_secs),
|
||||||
bytes_bad_in_main_title: main_title_bad,
|
bytes_bad_in_main_title: main_title_bad,
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ pub struct PassProgress {
|
|||||||
pub bytes_good_total: u64,
|
pub bytes_good_total: u64,
|
||||||
pub bytes_unreadable_total: u64,
|
pub bytes_unreadable_total: u64,
|
||||||
pub bytes_pending_total: u64,
|
pub bytes_pending_total: u64,
|
||||||
|
/// Bytes that FAILED to read and await retry (NonTrimmed/NonScraped) —
|
||||||
|
/// distinct from `bytes_pending_total` which also includes not-yet-attempted
|
||||||
|
/// (NonTried) bytes. Used so "lost" counts only failed reads, never unread
|
||||||
|
/// sectors.
|
||||||
|
pub bytes_retryable_total: u64,
|
||||||
pub bytes_total_disc: u64,
|
pub bytes_total_disc: u64,
|
||||||
pub disc_duration_secs: Option<f64>,
|
pub disc_duration_secs: Option<f64>,
|
||||||
/// How many bytes of the worst-case damage (unreadable + pending) fall
|
/// How many bytes of the worst-case damage (unreadable + pending) fall
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ pub fn verify_title(
|
|||||||
bytes_good_total: (good + slow + recovered) * 2048,
|
bytes_good_total: (good + slow + recovered) * 2048,
|
||||||
bytes_unreadable_total: bad * 2048,
|
bytes_unreadable_total: bad * 2048,
|
||||||
bytes_pending_total: 0,
|
bytes_pending_total: 0,
|
||||||
|
bytes_retryable_total: 0,
|
||||||
bytes_total_disc: total_sectors * 2048,
|
bytes_total_disc: total_sectors * 2048,
|
||||||
disc_duration_secs: Some(title.duration_secs),
|
disc_duration_secs: Some(title.duration_secs),
|
||||||
bytes_bad_in_main_title: 0,
|
bytes_bad_in_main_title: 0,
|
||||||
@@ -264,6 +265,7 @@ pub fn verify_title(
|
|||||||
bytes_good_total: (good + slow + recovered) * 2048,
|
bytes_good_total: (good + slow + recovered) * 2048,
|
||||||
bytes_unreadable_total: bad * 2048,
|
bytes_unreadable_total: bad * 2048,
|
||||||
bytes_pending_total: 0,
|
bytes_pending_total: 0,
|
||||||
|
bytes_retryable_total: 0,
|
||||||
bytes_total_disc: total_sectors * 2048,
|
bytes_total_disc: total_sectors * 2048,
|
||||||
disc_duration_secs: Some(title.duration_secs),
|
disc_duration_secs: Some(title.duration_secs),
|
||||||
bytes_bad_in_main_title: 0,
|
bytes_bad_in_main_title: 0,
|
||||||
@@ -327,6 +329,7 @@ pub fn verify_title(
|
|||||||
bytes_good_total: (good + slow + recovered) * 2048,
|
bytes_good_total: (good + slow + recovered) * 2048,
|
||||||
bytes_unreadable_total: bad * 2048,
|
bytes_unreadable_total: bad * 2048,
|
||||||
bytes_pending_total: 0,
|
bytes_pending_total: 0,
|
||||||
|
bytes_retryable_total: 0,
|
||||||
bytes_total_disc: total_sectors * 2048,
|
bytes_total_disc: total_sectors * 2048,
|
||||||
disc_duration_secs: Some(title.duration_secs),
|
disc_duration_secs: Some(title.duration_secs),
|
||||||
bytes_bad_in_main_title: 0,
|
bytes_bad_in_main_title: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user