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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user