mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
udp: simplify statistics code further
This commit is contained in:
parent
953ede7f67
commit
c192ee6e5a
2 changed files with 42 additions and 66 deletions
|
|
@ -12,7 +12,7 @@ use time::format_description::well_known::Rfc2822;
|
|||
use time::OffsetDateTime;
|
||||
use tinytemplate::TinyTemplate;
|
||||
|
||||
use collector::{FormattedStatistics, StatisticsCollector};
|
||||
use collector::{CollectedStatistics, StatisticsCollector};
|
||||
|
||||
use crate::common::*;
|
||||
use crate::config::Config;
|
||||
|
|
@ -31,8 +31,8 @@ struct TemplateData {
|
|||
ipv4_active: bool,
|
||||
ipv6_active: bool,
|
||||
extended_active: bool,
|
||||
ipv4: FormattedStatistics,
|
||||
ipv6: FormattedStatistics,
|
||||
ipv4: CollectedStatistics,
|
||||
ipv6: CollectedStatistics,
|
||||
last_updated: String,
|
||||
peer_update_interval: String,
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ pub fn run_statistics_worker(
|
|||
}
|
||||
}
|
||||
|
||||
fn print_to_stdout(config: &Config, statistics: &FormattedStatistics) {
|
||||
fn print_to_stdout(config: &Config, statistics: &CollectedStatistics) {
|
||||
println!(
|
||||
" bandwidth: {:>7} Mbit/s in, {:7} Mbit/s out",
|
||||
statistics.rx_mbits, statistics.tx_mbits,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue