feat: add Reset Stats button to admin LLM tracking panel

Allows resetting the LLM stats aggregation window without deleting
historical data. Stores a reset timestamp in metadata and filters
the aggregation query to only include calls after that point.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-13 01:59:24 +00:00
parent 513d35e0e5
commit b2ac0e7a00
8 changed files with 78 additions and 1 deletions
+8
View File
@@ -204,6 +204,14 @@ export class SocketServer {
socket.emit('admin-llm-stats-result', stats);
});
socket.on('admin-reset-llm-stats', () => {
if (!this.authenticatedSockets.has(socket.id)) return;
this.gameLoop.llmStatsService.resetStats();
const stats = this.gameLoop.llmStatsService.getStats();
socket.emit('admin-llm-stats-result', stats);
this.gameLoop.logService.log('info', 'Game', 'Admin reset LLM stats');
});
socket.on('admin-toggle-llm-tracking', (data: { enabled: boolean }) => {
if (!this.authenticatedSockets.has(socket.id)) return;
this.gameLoop.llmStatsService.setTrackingEnabled(data.enabled);