| 10 | import type { ExecutionEventContext, SimSubscriptionConfig } from '@/lib/workspace-events/types' |
| 11 | |
| 12 | function makeConfig(overrides: Partial<SimSubscriptionConfig> = {}): SimSubscriptionConfig { |
| 13 | return { |
| 14 | eventType: 'execution_error', |
| 15 | workflowIds: [], |
| 16 | consecutiveFailures: 3, |
| 17 | failureRatePercent: 50, |
| 18 | windowHours: 24, |
| 19 | durationThresholdMs: 30000, |
| 20 | latencySpikePercent: 100, |
| 21 | costThresholdCredits: 200, |
| 22 | errorCountThreshold: 10, |
| 23 | inactivityHours: 24, |
| 24 | ...overrides, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | function makeContext(overrides: Partial<ExecutionEventContext> = {}): ExecutionEventContext { |
| 29 | return { |