(bytes: u64)
| 27 | use super::s3; |
| 28 | |
| 29 | fn human_bytes(bytes: u64) -> String { |
| 30 | const KB: u64 = 1024; |
| 31 | const MB: u64 = KB * 1024; |
| 32 | const GB: u64 = MB * 1024; |
| 33 | |
| 34 | if bytes >= GB { |
| 35 | format!("{:.2} GB", bytes as f64 / GB as f64) |
| 36 | } else if bytes >= MB { |
| 37 | format!("{:.2} MB", bytes as f64 / MB as f64) |
| 38 | } else if bytes >= KB { |
| 39 | format!("{:.2} KB", bytes as f64 / KB as f64) |
| 40 | } else { |
| 41 | format!("{bytes}") |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | fn human_bytes_per_second(bytes: u64, elapsed: std::time::Duration) -> String { |
| 46 | let bytes_per_second = bytes as f64 / elapsed.as_secs_f64(); |
nothing calls this directly
no outgoing calls
no test coverage detected