@@ -2,7 +2,7 @@ use std::sync::Arc;
22
33use bittorrent_tracker_core:: torrent:: repository:: in_memory:: InMemoryTorrentRepository ;
44use bittorrent_udp_tracker_core:: services:: banning:: BanService ;
5- use bittorrent_udp_tracker_core:: { self , statistics as udp_core_statistics } ;
5+ use bittorrent_udp_tracker_core:: { self } ;
66use tokio:: sync:: RwLock ;
77use torrust_tracker_primitives:: swarm_metadata:: AggregateSwarmMetadata ;
88use torrust_udp_tracker_server:: statistics as udp_server_statistics;
@@ -29,13 +29,11 @@ pub async fn get_metrics(
2929 in_memory_torrent_repository : Arc < InMemoryTorrentRepository > ,
3030 ban_service : Arc < RwLock < BanService > > ,
3131 http_stats_repository : Arc < bittorrent_http_tracker_core:: statistics:: repository:: Repository > ,
32- udp_core_stats_repository : Arc < udp_core_statistics:: repository:: Repository > ,
3332 udp_server_stats_repository : Arc < udp_server_statistics:: repository:: Repository > ,
3433) -> TrackerMetrics {
3534 let torrents_metrics = in_memory_torrent_repository. get_torrents_metrics ( ) ;
3635 let udp_banned_ips_total = ban_service. read ( ) . await . get_banned_ips_total ( ) ;
3736 let http_stats = http_stats_repository. get_stats ( ) . await ;
38- let udp_core_stats = udp_core_stats_repository. get_stats ( ) . await ;
3937 let udp_server_stats = udp_server_stats_repository. get_stats ( ) . await ;
4038
4139 // For backward compatibility we keep the `tcp4_connections_handled` and
@@ -63,16 +61,16 @@ pub async fn get_metrics(
6361 udp_avg_scrape_processing_time_ns : udp_server_stats. udp_avg_scrape_processing_time_ns ,
6462 // UDPv4
6563 udp4_requests : udp_server_stats. udp4_requests ,
66- udp4_connections_handled : udp_core_stats . udp4_connections_handled ,
67- udp4_announces_handled : udp_core_stats . udp4_announces_handled ,
68- udp4_scrapes_handled : udp_core_stats . udp4_scrapes_handled ,
64+ udp4_connections_handled : udp_server_stats . udp4_connections_handled ,
65+ udp4_announces_handled : udp_server_stats . udp4_announces_handled ,
66+ udp4_scrapes_handled : udp_server_stats . udp4_scrapes_handled ,
6967 udp4_responses : udp_server_stats. udp4_responses ,
7068 udp4_errors_handled : udp_server_stats. udp4_errors_handled ,
7169 // UDPv6
7270 udp6_requests : udp_server_stats. udp6_requests ,
73- udp6_connections_handled : udp_core_stats . udp6_connections_handled ,
74- udp6_announces_handled : udp_core_stats . udp6_announces_handled ,
75- udp6_scrapes_handled : udp_core_stats . udp6_scrapes_handled ,
71+ udp6_connections_handled : udp_server_stats . udp6_connections_handled ,
72+ udp6_announces_handled : udp_server_stats . udp6_announces_handled ,
73+ udp6_scrapes_handled : udp_server_stats . udp6_scrapes_handled ,
7674 udp6_responses : udp_server_stats. udp6_responses ,
7775 udp6_errors_handled : udp_server_stats. udp6_errors_handled ,
7876 } ,
@@ -112,9 +110,8 @@ mod tests {
112110 let http_stats_repository = Arc :: new ( http_stats_repository) ;
113111
114112 // UDP core stats
115- let ( _udp_stats_event_sender, udp_stats_repository ) =
113+ let ( _udp_stats_event_sender, _udp_stats_repository ) =
116114 bittorrent_udp_tracker_core:: statistics:: setup:: factory ( config. core . tracker_usage_statistics ) ;
117- let udp_stats_repository = Arc :: new ( udp_stats_repository) ;
118115
119116 // UDP server stats
120117 let ( _udp_server_stats_event_sender, udp_server_stats_repository) =
@@ -125,7 +122,6 @@ mod tests {
125122 in_memory_torrent_repository. clone ( ) ,
126123 ban_service. clone ( ) ,
127124 http_stats_repository. clone ( ) ,
128- udp_stats_repository. clone ( ) ,
129125 udp_server_stats_repository. clone ( ) ,
130126 )
131127 . await ;
0 commit comments