Problem
TopologyManager::report_resource_usage() is marked #[allow(dead_code)] // fixme: use this and is only called from test code within the topology module. No production code feeds resource usage data into the Meter.
This means calculate_usage_proportion() always returns ~0% usage, so adjust_topology() always takes the "usage below 50% → add connections" branch. The resource-usage-based decision logic (add when <50%, hold at 50-90%, remove when >90%) effectively never gates connection changes based on actual load.
Affected code
crates/core/src/topology/mod.rs — report_resource_usage() (line ~237), report_split_resource_usage() (line ~220)
crates/core/src/topology/meter.rs — Meter struct and all its attribution tracking
crates/core/src/topology/mod.rs — calculate_usage_proportion(), extrapolated_usage()
Impact
- The topology manager cannot make load-aware decisions about adding/removing connections
- The "remove worst-value peer when overloaded" path (
select_connections_to_remove) is unreachable in production
- Tests pass because they call
report_resource_usage directly, masking the production gap
What needs to happen
Wire up actual resource usage reporting from the node's event loop or transport layer into TopologyManager::report_resource_usage(). The meter infrastructure exists and is tested — it just needs a caller that feeds it real bandwidth/CPU data from production traffic.
[AI-assisted - Claude]
Problem
TopologyManager::report_resource_usage()is marked#[allow(dead_code)] // fixme: use thisand is only called from test code within the topology module. No production code feeds resource usage data into theMeter.This means
calculate_usage_proportion()always returns ~0% usage, soadjust_topology()always takes the "usage below 50% → add connections" branch. The resource-usage-based decision logic (add when <50%, hold at 50-90%, remove when >90%) effectively never gates connection changes based on actual load.Affected code
crates/core/src/topology/mod.rs—report_resource_usage()(line ~237),report_split_resource_usage()(line ~220)crates/core/src/topology/meter.rs—Meterstruct and all its attribution trackingcrates/core/src/topology/mod.rs—calculate_usage_proportion(),extrapolated_usage()Impact
select_connections_to_remove) is unreachable in productionreport_resource_usagedirectly, masking the production gapWhat needs to happen
Wire up actual resource usage reporting from the node's event loop or transport layer into
TopologyManager::report_resource_usage(). The meter infrastructure exists and is tested — it just needs a caller that feeds it real bandwidth/CPU data from production traffic.[AI-assisted - Claude]