@@ -8,7 +8,7 @@ use torrust_tracker_metrics::metric_collection::MetricCollection;
88use torrust_udp_tracker_server:: statistics as udp_server_statistics;
99
1010use super :: metrics:: TorrentsMetrics ;
11- use crate :: statistics:: metrics:: Metrics ;
11+ use crate :: statistics:: metrics:: ProtocolMetrics ;
1212
1313/// All the metrics collected by the tracker.
1414#[ derive( Debug , PartialEq ) ]
@@ -21,7 +21,7 @@ pub struct TrackerMetrics {
2121 /// Application level metrics. Usage statistics/metrics.
2222 ///
2323 /// Metrics about how the tracker is been used (number of udp announce requests, number of http scrape requests, etcetera)
24- pub protocol_metrics : Metrics ,
24+ pub protocol_metrics : ProtocolMetrics ,
2525}
2626
2727/// It returns all the [`TrackerMetrics`]
@@ -56,7 +56,7 @@ async fn get_protocol_metrics(
5656 ban_service : Arc < RwLock < BanService > > ,
5757 http_stats_repository : Arc < bittorrent_http_tracker_core:: statistics:: repository:: Repository > ,
5858 udp_server_stats_repository : Arc < udp_server_statistics:: repository:: Repository > ,
59- ) -> Metrics {
59+ ) -> ProtocolMetrics {
6060 let udp_banned_ips_total = ban_service. read ( ) . await . get_banned_ips_total ( ) ;
6161 let http_stats = http_stats_repository. get_stats ( ) . await ;
6262 let udp_server_stats = udp_server_stats_repository. get_stats ( ) . await ;
@@ -66,7 +66,7 @@ async fn get_protocol_metrics(
6666 // tracker, but we keep them for now. In new major versions we should remove
6767 // them.
6868
69- Metrics {
69+ ProtocolMetrics {
7070 // TCPv4
7171 tcp4_connections_handled : http_stats. tcp4_announces_handled + http_stats. tcp4_scrapes_handled ,
7272 tcp4_announces_handled : http_stats. tcp4_announces_handled ,
@@ -168,7 +168,7 @@ mod tests {
168168 use torrust_tracker_test_helpers:: configuration;
169169 use torrust_tracker_torrent_repository:: container:: TorrentRepositoryContainer ;
170170
171- use crate :: statistics:: metrics:: { Metrics , TorrentsMetrics } ;
171+ use crate :: statistics:: metrics:: { ProtocolMetrics , TorrentsMetrics } ;
172172 use crate :: statistics:: services:: { get_metrics, TrackerMetrics } ;
173173
174174 pub fn tracker_configuration ( ) -> Configuration {
@@ -214,7 +214,7 @@ mod tests {
214214 tracker_metrics,
215215 TrackerMetrics {
216216 torrents_metrics: TorrentsMetrics :: default ( ) ,
217- protocol_metrics: Metrics :: default ( ) ,
217+ protocol_metrics: ProtocolMetrics :: default ( ) ,
218218 }
219219 ) ;
220220 }
0 commit comments