From 5b3d589bf2478d9448c34e2d3bc11c0f1dc07dba Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 10 Sep 2023 20:36:39 -0400 Subject: [PATCH] print max --- veilid-core/src/routing_table/routing_table_inner.rs | 2 +- veilid-core/src/veilid_api/debug.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/veilid-core/src/routing_table/routing_table_inner.rs b/veilid-core/src/routing_table/routing_table_inner.rs index 6da5cefa..c2cfc291 100644 --- a/veilid-core/src/routing_table/routing_table_inner.rs +++ b/veilid-core/src/routing_table/routing_table_inner.rs @@ -1,7 +1,7 @@ use super::*; use weak_table::PtrWeakHashSet; -const RECENT_PEERS_TABLE_SIZE: usize = 64; +pub const RECENT_PEERS_TABLE_SIZE: usize = 64; pub type EntryCounts = BTreeMap<(RoutingDomain, CryptoKind), usize>; ////////////////////////////////////////////////////////////////////////// diff --git a/veilid-core/src/veilid_api/debug.rs b/veilid-core/src/veilid_api/debug.rs index cc7ed02f..633f77f4 100644 --- a/veilid-core/src/veilid_api/debug.rs +++ b/veilid-core/src/veilid_api/debug.rs @@ -687,7 +687,11 @@ impl VeilidAPI { // Dump core state let state = self.get_state().await?; - let mut peertable = format!("Recent Peers: {}\n", state.network.peers.len()); + let mut peertable = format!( + "Recent Peers: {} (max {})\n", + state.network.peers.len(), + RECENT_PEERS_TABLE_SIZE + ); for peer in state.network.peers { peertable += &format!( " {} | {} | {} | {} down | {} up\n",