Router: Don't update rates for full stats when not enabled

This commit is contained in:
zzz
2024-06-01 10:49:32 -04:00
parent ab100793dc
commit d7fbc79533

View File

@@ -57,20 +57,12 @@ public class CoalesceStatsEvent implements SimpleTimer.TimedEvent {
int active = _ctx.commSystem().countActivePeers();
sm.addRateData("router.activePeers", active);
int activeSend = _ctx.commSystem().countActiveSendPeers();
sm.addRateData("router.activeSendPeers", activeSend);
int fast = _ctx.profileOrganizer().countFastPeers();
sm.addRateData("router.fastPeers", fast);
int highCap = _ctx.profileOrganizer().countHighCapacityPeers();
sm.addRateData("router.highCapacityPeers", highCap);
int integrated = _ctx.peerManager().countPeersByCapability(FloodfillNetworkDatabaseFacade.CAPABILITY_FLOODFILL);
sm.addRateData("router.integratedPeers", integrated);
sm.addRateData("router.knownPeers", _ctx.netDb().getKnownRouters());
sm.addRateData("bw.sendRate", (long)_ctx.bandwidthLimiter().getSendBps());
sm.addRateData("bw.recvRate", (long)_ctx.bandwidthLimiter().getReceiveBps());
@@ -103,6 +95,16 @@ public class CoalesceStatsEvent implements SimpleTimer.TimedEvent {
sm.addRateData("bw.sendBps", (long)bps, 60*1000);
}
}
if (_ctx.getBooleanProperty("stat.full")) {
int activeSend = _ctx.commSystem().countActiveSendPeers();
sm.addRateData("router.activeSendPeers", activeSend);
int integrated = _ctx.peerManager().countPeersByCapability(FloodfillNetworkDatabaseFacade.CAPABILITY_FLOODFILL);
sm.addRateData("router.integratedPeers", integrated);
sm.addRateData("router.knownPeers", _ctx.netDb().getKnownRouters());
}
}
/**