One more try before I go and eat something...

This commit is contained in:
Herbert Wolverson
2024-03-18 16:13:06 -05:00
parent ebc3ab73da
commit e45bedc7ce

View File

@@ -80,21 +80,6 @@ impl TimeBuffer {
if last_country != country { if last_country != country {
if !last_country.is_empty() { if !last_country.is_empty() {
// Store the country // Store the country
let rtt = [
if total_rtt[0] > 0.0 {
rtt_count[0] += 1;
(total_rtt[0] / rtt_count[0] as f64) as f32
} else {
0.0
},
if total_rtt[1] > 0.0 {
rtt_count[1] += 1;
(total_rtt[1] / rtt_count[1] as f64) as f32
} else {
0.0
},
];
if rtt_count[0] > 0 { if rtt_count[0] > 0 {
total_rtt[0] = (total_rtt[0] / rtt_count[0] as f64) as f64; total_rtt[0] = (total_rtt[0] / rtt_count[0] as f64) as f64;
} }
@@ -117,11 +102,15 @@ impl TimeBuffer {
} }
total_bytes[0] += bytes[0]; total_bytes[0] += bytes[0];
total_bytes[1] += bytes[1]; total_bytes[1] += bytes[1];
if rtt[0] > 0.0 {
total_rtt[0] += rtt[0] as f64; total_rtt[0] += rtt[0] as f64;
total_rtt[1] += rtt[1] as f64;
rtt_count[0] += 1; rtt_count[0] += 1;
}
if rtt[1] > 0.0 {
total_rtt[1] += rtt[1] as f64;
rtt_count[1] += 1; rtt_count[1] += 1;
} }
}
// Store the last country // Store the last country
let rtt = [ let rtt = [