Initialization progress reporting
This commit is contained in:
parent
b79a21179f
commit
876afbf41b
9 changed files with 109 additions and 40 deletions
|
|
@ -163,7 +163,7 @@ impl TorrentStateLive {
|
|||
let speed_estimator = SpeedEstimator::new(5);
|
||||
|
||||
let have_bytes = paused.have_bytes;
|
||||
let needed_bytes = paused.needed_bytes;
|
||||
let needed_bytes = paused.info.lengths.total_length() - have_bytes;
|
||||
let lengths = *paused.chunk_tracker.get_lengths();
|
||||
|
||||
let state = Arc::new(TorrentStateLive {
|
||||
|
|
@ -533,7 +533,6 @@ impl TorrentStateLive {
|
|||
fetched_bytes: self.stats.fetched_bytes.load(Relaxed),
|
||||
uploaded_bytes: self.stats.uploaded_bytes.load(Relaxed),
|
||||
total_bytes: self.have_plus_needed_bytes,
|
||||
time: Instant::now(),
|
||||
initially_needed_bytes: self.needed_bytes,
|
||||
remaining_bytes: remaining,
|
||||
total_piece_download_ms: self.stats.total_piece_download_ms.load(Relaxed),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use serde::Serialize;
|
|||
|
||||
use crate::torrent_state::live::peers::stats::snapshot::AggregatePeerStats;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[derive(Debug, Serialize, Default)]
|
||||
pub struct StatsSnapshot {
|
||||
pub have_bytes: u64,
|
||||
pub downloaded_and_checked_bytes: u64,
|
||||
|
|
@ -14,8 +14,8 @@ pub struct StatsSnapshot {
|
|||
pub initially_needed_bytes: u64,
|
||||
pub remaining_bytes: u64,
|
||||
pub total_bytes: u64,
|
||||
#[serde(skip)]
|
||||
pub time: Instant,
|
||||
// #[serde(skip)]
|
||||
// pub time: Instant,
|
||||
pub total_piece_download_ms: u64,
|
||||
pub peer_stats: AggregatePeerStats,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue