ws: support serving metrics on peer id prefixes

This commit is contained in:
Joakim Frostegård 2023-06-14 11:36:08 +02:00
parent 6675126d08
commit 0204b6fcc2
2 changed files with 42 additions and 9 deletions

View file

@ -156,10 +156,16 @@ pub struct MetricsConfig {
pub prometheus_endpoint_address: SocketAddr,
/// Update metrics for torrent count this often (seconds)
pub torrent_count_update_interval: u64,
/// Collect data on peer clients.
/// Serve information on peer clients
///
/// Expect a certain CPU hit
pub peer_clients: bool,
/// Serve information on all peer id prefixes
///
/// Requires `peer_clients` to be activated.
///
/// Expect a certain CPU hit
pub peer_id_prefixes: bool,
}
#[cfg(feature = "metrics")]
@ -170,6 +176,7 @@ impl Default for MetricsConfig {
prometheus_endpoint_address: SocketAddr::from(([0, 0, 0, 0], 9000)),
torrent_count_update_interval: 10,
peer_clients: false,
peer_id_prefixes: false,
}
}
}