huge optimizations

This commit is contained in:
KingKDot
2026-06-08 22:33:34 -05:00
parent 9a1fc96e2b
commit d6ad2cadea
21 changed files with 649 additions and 72 deletions
@@ -0,0 +1,16 @@
import { describe, expect, test } from "bun:test";
import { getHeartbeatBatchSize } from "./maintenance-loops";
describe("maintenance heartbeat batching", () => {
test("spreads large fleets across the heartbeat interval", () => {
expect(getHeartbeatBatchSize(1000, 30_000)).toBe(34);
});
test("keeps small fleets responsive", () => {
expect(getHeartbeatBatchSize(10, 30_000)).toBe(1);
});
test("handles empty fleets", () => {
expect(getHeartbeatBatchSize(0, 30_000)).toBe(0);
});
});