mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
udp: only include prometheus fields in config if feature enabled
This commit is contained in:
parent
9bd4062e44
commit
3806faaff9
3 changed files with 41 additions and 9 deletions
|
|
@ -57,8 +57,16 @@ pub fn run_statistics_worker(
|
|||
None
|
||||
};
|
||||
|
||||
let mut ipv4_collector = StatisticsCollector::new(shared_state.statistics_ipv4, "4".into());
|
||||
let mut ipv6_collector = StatisticsCollector::new(shared_state.statistics_ipv6, "6".into());
|
||||
let mut ipv4_collector = StatisticsCollector::new(
|
||||
shared_state.statistics_ipv4,
|
||||
#[cfg(feature = "prometheus")]
|
||||
"4".into(),
|
||||
);
|
||||
let mut ipv6_collector = StatisticsCollector::new(
|
||||
shared_state.statistics_ipv6,
|
||||
#[cfg(feature = "prometheus")]
|
||||
"6".into(),
|
||||
);
|
||||
|
||||
loop {
|
||||
::std::thread::sleep(Duration::from_secs(config.statistics.interval));
|
||||
|
|
@ -70,8 +78,14 @@ pub fn run_statistics_worker(
|
|||
}
|
||||
}
|
||||
|
||||
let statistics_ipv4 = ipv4_collector.collect_from_shared(&config);
|
||||
let statistics_ipv6 = ipv6_collector.collect_from_shared(&config);
|
||||
let statistics_ipv4 = ipv4_collector.collect_from_shared(
|
||||
#[cfg(feature = "prometheus")]
|
||||
&config,
|
||||
);
|
||||
let statistics_ipv6 = ipv6_collector.collect_from_shared(
|
||||
#[cfg(feature = "prometheus")]
|
||||
&config,
|
||||
);
|
||||
|
||||
if config.statistics.print_to_stdout {
|
||||
println!("General:");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue