Spread fleet replicas across extra machines and show message RTT percentiles
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
machines.json plus Add-machine UI place copies on the least-loaded host. Monitor samples processing RTT and displays min, avg, p50, and p90 for capacity planning. Remote hosts run src/agent.js.
This commit is contained in:
parent
6fbc808bb1
commit
b325f6f697
17 changed files with 673 additions and 53 deletions
|
|
@ -37,6 +37,22 @@ export function startControlServer(sup, mon) {
|
|||
if (req.method === 'GET' && url.pathname === '/api/status') {
|
||||
return json(res, 200, { ...sup.status(), monitor: mon?.last || null });
|
||||
}
|
||||
if (req.method === 'GET' && url.pathname === '/api/machines') {
|
||||
return json(res, 200, { machines: sup.status().machines });
|
||||
}
|
||||
if (req.method === 'POST' && url.pathname === '/api/machines') {
|
||||
const chunks = [];
|
||||
for await (const c of req) chunks.push(c);
|
||||
const spec = JSON.parse(Buffer.concat(chunks).toString('utf8') || '{}');
|
||||
const m = sup.addMachine(spec);
|
||||
return json(res, 200, { machine: m, machines: sup.status().machines });
|
||||
}
|
||||
const mach = url.pathname.match(/^\/api\/machines\/([^/]+)\/(enable|disable)$/);
|
||||
if (mach && req.method === 'POST') {
|
||||
const [, id, op] = mach;
|
||||
const m = sup.setMachineEnabled(id, op === 'enable');
|
||||
return json(res, 200, { machine: m, machines: sup.status().machines });
|
||||
}
|
||||
if (req.method === 'POST' && url.pathname === '/api/reconcile') {
|
||||
const actions = await sup.reconcile();
|
||||
return json(res, 200, { actions, status: sup.status() });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue