agent-orchestrator/ui-electrobun/src/bun/rpc-stats.ts
Hibryda 66dce7ebae fix(electrobun): 7 bug fixes + 3 partial features completed
Bugs fixed:
- Agent retry: clear dead session on failed start (was non-recoverable)
- seqId persist: save seq_id column in agent_messages, migrate existing DBs
- Window frame save: wire resize event listener to saveWindowFrame()
- Diagnostics counters: real RPC call counter via withRpcCounting() proxy

Partial features completed:
- Search auto-seed: rebuildIndex() on startup + indexMessage() on save
- Notifications: removed 3 hardcoded demo entries, start empty
- Agent cost streaming: emitCostIfChanged() on every message batch

New: src/bun/rpc-stats.ts (RPC call + dropped event counters)
2026-03-25 20:26:49 +01:00

23 lines
457 B
TypeScript

/**
* Simple RPC call counter for diagnostics.
* Incremented on each RPC request, read by diagnostics.stats handler.
*/
let _rpcCallCount = 0;
let _droppedEvents = 0;
export function incrementRpcCallCount(): void {
_rpcCallCount++;
}
export function incrementDroppedEvents(): void {
_droppedEvents++;
}
export function getRpcCallCount(): number {
return _rpcCallCount;
}
export function getDroppedEvents(): number {
return _droppedEvents;
}