mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
udp: improve statistics structs
- Now, workers don't need to keep track of which atomic usize to update - Additionally, prometheus now gets separate information per socket worker
This commit is contained in:
parent
e2e525b560
commit
405bbaca93
12 changed files with 400 additions and 294 deletions
|
|
@ -44,6 +44,7 @@ struct TemplateData {
|
|||
pub fn run_statistics_worker(
|
||||
config: Config,
|
||||
shared_state: State,
|
||||
statistics: Statistics,
|
||||
statistics_receiver: Receiver<StatisticsMessage>,
|
||||
) -> anyhow::Result<()> {
|
||||
let process_peer_client_data = {
|
||||
|
|
@ -68,16 +69,8 @@ pub fn run_statistics_worker(
|
|||
None
|
||||
};
|
||||
|
||||
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(),
|
||||
);
|
||||
let mut ipv4_collector = StatisticsCollector::new(statistics.clone(), IpVersion::V4);
|
||||
let mut ipv6_collector = StatisticsCollector::new(statistics, IpVersion::V6);
|
||||
|
||||
// Store a count to enable not removing peers from the count completely
|
||||
// just because they were removed from one torrent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue