Skip to content

Commit 8345adc

Browse files
committed
improvement(stats): should track mcp and a2a executions like other trigger types
1 parent 5f45db4 commit 8345adc

File tree

5 files changed

+10401
-0
lines changed

5 files changed

+10401
-0
lines changed

apps/sim/lib/logs/execution/logger.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,12 @@ export class ExecutionLogger implements IExecutionLoggerService {
543543
case 'chat':
544544
updateFields.totalChatExecutions = sql`total_chat_executions + 1`
545545
break
546+
case 'mcp':
547+
updateFields.totalMcpExecutions = sql`total_mcp_executions + 1`
548+
break
549+
case 'a2a':
550+
updateFields.totalA2aExecutions = sql`total_a2a_executions + 1`
551+
break
546552
}
547553

548554
await db.update(userStats).set(updateFields).where(eq(userStats.userId, userId))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "user_stats" ADD COLUMN "total_mcp_executions" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
2+
ALTER TABLE "user_stats" ADD COLUMN "total_a2a_executions" integer DEFAULT 0 NOT NULL;

0 commit comments

Comments
 (0)