修复滑动窗口出现负数的bug

This commit is contained in:
2026-10-07 12:34:23 +08:00
parent 862b860020
commit 156d74bbe3
20 changed files with 415 additions and 416 deletions
@@ -61,7 +61,7 @@ public class KLALBController {
public HighAccuracyClock getClock() {
return clock;
}
private final long TIME_WINDOW=50000000000L;
private final long TIME_WINDOW=30000000000L;
private SpeedAndTrafficMonitorDataImpl linkMonitor = new SpeedAndTrafficMonitorDataImpl(
new HashMapTimestampMonitor<UUID>(HighAccuracyClock.SYSTEM_CLOCK, "up", 100,TIME_WINDOW ),
new HashMapTimestampMonitor<UUID>(HighAccuracyClock.SYSTEM_CLOCK, "down", 100, TIME_WINDOW));
@@ -733,9 +733,11 @@ public class KLALBController {
}
protected void initKLALB(boolean enableVirtualAdapter, IPv6AddressGroup selfg) {
KLALBScheduler.getScheduler().scheduleAtFixedRate( ()->{
KLALBScheduler.getScheduler().scheduleWithFixedDelay( ()->{
linkMonitor.update();
datatMonitor.update();
},1,1,TimeUnit.MILLISECONDS);
KLALBScheduler.getScheduler().scheduleWithFixedDelay( ()->{
datatMonitor.update();
},1,1,TimeUnit.MILLISECONDS);
loadSRv6ProtocolStack(selfg, enableVirtualAdapter);
loadController();