From 65d2e5b87f08b1c9050f723da54f6bfedbeaf23a Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Wed, 14 Jul 2021 13:42:42 +0100 Subject: [PATCH] Nothing --- crates/dht/src/dht.rs | 4 ---- crates/librqbit/src/torrent_manager.rs | 5 ----- crates/rqbit/src/main.rs | 9 +++++---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/crates/dht/src/dht.rs b/crates/dht/src/dht.rs index 16b45e2..0f7f41a 100644 --- a/crates/dht/src/dht.rs +++ b/crates/dht/src/dht.rs @@ -231,10 +231,6 @@ impl DhtState { } } - pub fn get_routing_table(&self) -> &RoutingTable { - &self.routing_table - } - pub fn get_peers( &mut self, info_hash: Id20, diff --git a/crates/librqbit/src/torrent_manager.rs b/crates/librqbit/src/torrent_manager.rs index 5d1ad8d..0a512a6 100644 --- a/crates/librqbit/src/torrent_manager.rs +++ b/crates/librqbit/src/torrent_manager.rs @@ -244,11 +244,6 @@ impl TorrentManager { options, }); - // spawn("stats printer", { - // let this = mgr.clone(); - // async move { this.stats_printer().await } - // }); - spawn("speed estimator updater", { let state = mgr.state.clone(); async move { diff --git a/crates/rqbit/src/main.rs b/crates/rqbit/src/main.rs index 8c818e0..2f8e40e 100644 --- a/crates/rqbit/src/main.rs +++ b/crates/rqbit/src/main.rs @@ -367,7 +367,6 @@ async fn main_torrent_info( let handle = handle.clone(); async move { loop { - let dht_stats = dht.as_ref().map(|d| d.stats()); let peer_stats = handle.torrent_state().peer_stats_snapshot(); let stats = handle.torrent_state().stats_snapshot(); let needed = stats.initially_needed_bytes; @@ -377,7 +376,7 @@ async fn main_torrent_info( (stats.downloaded_and_checked_bytes as f64 / needed as f64) * 100f64 }; info!( - "Stats: downloaded {:.2}% ({:.2}), fetched {}, remaining {:.2} out of {:.2}, uploaded {:.2}, have {:.2}, peers: {:?}, dht: {:?}", + "Stats: downloaded {:.2}% ({:.2}), fetched {}, remaining {:.2} out of {:.2}, uploaded {:.2}, have {:.2}, peers: {{live: {}, connecting: {}, queued: {}, seen: {}}}", downloaded_pct, SF::new(stats.downloaded_and_checked_bytes), SF::new(stats.fetched_bytes), @@ -385,8 +384,10 @@ async fn main_torrent_info( SF::new(needed), SF::new(stats.uploaded_bytes), SF::new(stats.have_bytes), - peer_stats, - dht_stats, + peer_stats.live, + peer_stats.connecting, + peer_stats.queued, + peer_stats.seen, ); tokio::time::sleep(Duration::from_secs(1)).await; }