Better output layout for iftop logs (#6690)

automerge
This commit is contained in:
Pankaj Garg 2019-11-01 16:36:02 -07:00 committed by Grimes
parent a57f6b70da
commit f9a9b7f610
1 changed files with 6 additions and 4 deletions

View File

@ -33,11 +33,13 @@ impl Default for LogLine {
impl LogLine {
fn output(a: &str, b: &str, v1: u128, v2: u128) -> String {
format!(
"Lost {} bytes ({} - {}, {}%) from {} to {}",
v1 - v2,
v1,
v2,
"Lost {}%, {}, ({} - {}), sender {}, receiver {}",
((v1 - v2) * 100 / v1),
Byte::from_bytes(v1 - v2)
.get_appropriate_unit(true)
.to_string(),
Byte::from_bytes(v1).get_appropriate_unit(true).to_string(),
Byte::from_bytes(v2).get_appropriate_unit(true).to_string(),
a,
b
)