From 9c5b4606aa5eb6b1f27778e0dfa0fadd28f1eb48 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 3 Nov 2026 05:18:10 +0000 Subject: [PATCH 1/2] show network bytes sent, received, and total Append the already sampled counter strings to the networking list after IPv4. Co-authored-by: jameslincn --- src/pages/network.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/pages/network.rs b/src/pages/network.rs index 34c3f75..0cec896 100644 --- a/src/pages/network.rs +++ b/src/pages/network.rs @@ -1051,6 +1051,9 @@ impl NetworkPageState { (titles[2], 90, LVCFMT_RIGHT), (titles[3], 120, LVCFMT_LEFT), (titles[4], 140, LVCFMT_LEFT), + (titles[5], 110, LVCFMT_RIGHT), + (titles[6], 120, LVCFMT_RIGHT), + (titles[7], 110, LVCFMT_RIGHT), ]; for (index, (title, width, fmt)) in columns.iter().enumerate() { @@ -1406,13 +1409,16 @@ fn push_history(history: &mut HistoryBuffer, value: Option) { } } -fn adapter_row_texts(adapter: &NetworkAdapterEntry) -> [&str; 5] { +fn adapter_row_texts(adapter: &NetworkAdapterEntry) -> [&str; 8] { [ &adapter.name, &adapter.utilization, &adapter.link_speed, &adapter.state, &adapter.ipv4, + &adapter.bytes_sent, + &adapter.bytes_received, + &adapter.bytes_total, ] } @@ -2064,7 +2070,20 @@ mod tests { let adapter = test_adapter("Renamed Ethernet"); let columns = adapter_row_texts(&adapter); assert_eq!(columns[0], "Renamed Ethernet"); + assert_eq!(columns[2], "1.0 Gbps"); assert_eq!(columns[4], "192.168.0.2"); + assert_eq!(columns[5], "10"); + assert_eq!(columns[6], "20"); + assert_eq!(columns[7], "30"); + + let mut failed = adapter; + failed.bytes_sent = "-".to_string(); + failed.bytes_received = "-".to_string(); + failed.bytes_total = "-".to_string(); + let failed_columns = adapter_row_texts(&failed); + assert_eq!(failed_columns[5], "-"); + assert_eq!(failed_columns[6], "-"); + assert_eq!(failed_columns[7], "-"); } #[test] From 657995454a6bc9925c6f87b0a5985eb7fbb90ce4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 3 Nov 2026 05:53:25 +0000 Subject: [PATCH 2/2] wait longer for a collector panic report on loaded CI The panic hook flushes diagnostics and captures a backtrace before the collector can publish the failure. Poll for 30 seconds so that report and the reinitialized follow-up can arrive. Co-authored-by: jameslincn --- src/infrastructure/worker.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/infrastructure/worker.rs b/src/infrastructure/worker.rs index 7b40342..babb024 100644 --- a/src/infrastructure/worker.rs +++ b/src/infrastructure/worker.rs @@ -912,7 +912,14 @@ mod tests { .expect("follow-up request should coalesce"); assert!(worker.has_pending()); - let deadline = Instant::now() + Duration::from_secs(2); + // The collector publishes `CollectorPanicked` only after the panic hook + // flushes diagnostics and the default hook captures a backtrace. CI sets + // `RUST_BACKTRACE=1`, so a loaded Windows runner needs this longer poll + // before that report and the reinitialized follow-up can be observed. + const DRAIN_BUDGET: Duration = Duration::from_secs(30); + const POLL_INTERVAL: Duration = Duration::from_millis(20); + + let deadline = Instant::now() + DRAIN_BUDGET; loop { let drained = worker.drain(null_mut()); if drained.error == Some(ERROR_GEN_FAILURE) { @@ -922,10 +929,10 @@ mod tests { break; } assert!(Instant::now() < deadline, "panic report timed out"); - thread::yield_now(); + thread::sleep(POLL_INTERVAL); } - let deadline = Instant::now() + Duration::from_secs(2); + let deadline = Instant::now() + DRAIN_BUDGET; loop { let drained = worker.drain(null_mut()); assert_eq!(drained.error, None); @@ -939,7 +946,7 @@ mod tests { Instant::now() < deadline, "reinitialized collector timed out" ); - thread::yield_now(); + thread::sleep(POLL_INTERVAL); } }