Update: change Mbps to MiB/s
This commit is contained in:
parent
8b4027e3d6
commit
18713515b9
3 changed files with 4 additions and 4 deletions
|
|
@ -52,7 +52,7 @@ impl Speed {
|
||||||
fn new(mbps: f64) -> Self {
|
fn new(mbps: f64) -> Self {
|
||||||
Self {
|
Self {
|
||||||
mbps,
|
mbps,
|
||||||
human_readable: format!("{:.2}Mbps", mbps),
|
human_readable: format!("{:.2} MiB/s", mbps),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +221,7 @@ impl ApiInternal {
|
||||||
Some(StatsResponse {
|
Some(StatsResponse {
|
||||||
average_piece_download_time: snapshot.average_piece_download_time(),
|
average_piece_download_time: snapshot.average_piece_download_time(),
|
||||||
snapshot,
|
snapshot,
|
||||||
all_time_download_speed: (downloaded_mb * 8f64 / elapsed.as_secs_f64()).into(),
|
all_time_download_speed: (downloaded_mb / elapsed.as_secs_f64()).into(),
|
||||||
download_speed: estimator.download_mbps().into(),
|
download_speed: estimator.download_mbps().into(),
|
||||||
time_remaining: estimator.time_remaining(),
|
time_remaining: estimator.time_remaining(),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ impl SpeedEstimator {
|
||||||
|
|
||||||
let downloaded_bytes_diff = downloaded_bytes - first.downloaded_bytes;
|
let downloaded_bytes_diff = downloaded_bytes - first.downloaded_bytes;
|
||||||
let elapsed = instant - first.instant;
|
let elapsed = instant - first.instant;
|
||||||
let bps = downloaded_bytes_diff as f64 * 8f64 / elapsed.as_secs_f64();
|
let bps = downloaded_bytes_diff as f64 / elapsed.as_secs_f64();
|
||||||
|
|
||||||
let time_remaining_millis_rounded: u64 = if downloaded_bytes_diff > 0 {
|
let time_remaining_millis_rounded: u64 = if downloaded_bytes_diff > 0 {
|
||||||
let time_remaining_secs = remaining_bytes as f64 / bps;
|
let time_remaining_secs = remaining_bytes as f64 / bps;
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ async fn async_main(opts: Opts, spawner: BlockingSpawner) -> anyhow::Result<()>
|
||||||
(progress as f64 / total as f64) * 100f64
|
(progress as f64 / total as f64) * 100f64
|
||||||
};
|
};
|
||||||
info!(
|
info!(
|
||||||
"[{}]: {:.2}% ({:.2}), down speed {:.2} Mbps, fetched {}, remaining {:.2} of {:.2}, uploaded {:.2}, peers: {{live: {}, connecting: {}, queued: {}, seen: {}}}",
|
"[{}]: {:.2}% ({:.2}), down speed {:.2} MiB/s, fetched {}, remaining {:.2} of {:.2}, uploaded {:.2}, peers: {{live: {}, connecting: {}, queued: {}, seen: {}}}",
|
||||||
idx,
|
idx,
|
||||||
downloaded_pct,
|
downloaded_pct,
|
||||||
SF::new(progress),
|
SF::new(progress),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue