GetModeConfigs returns predefined mode configurations
()
| 62 | |
| 63 | // GetModeConfigs returns predefined mode configurations |
| 64 | func GetModeConfigs() map[PerformanceMode]ModeConfig { |
| 65 | return map[PerformanceMode]ModeConfig{ |
| 66 | ModeTest: { |
| 67 | Name: "Test Mode", |
| 68 | LambdaTimeout: 120, // 2 minutes - quick testing |
| 69 | LambdaMemory: 128, // Minimal memory |
| 70 | SessionTTL: 90 * time.Second, // 1.5 min sessions |
| 71 | OverlapWindow: 30 * time.Second, // 30s overlap |
| 72 | DrainTimeout: 15 * time.Second, // Quick drain |
| 73 | BufferSize: 8 * 1024, // 8KB buffers |
| 74 | MaxStreams: 100, // Limited streams |
| 75 | KeepAlive: 10 * time.Second, // Short keep-alive |
| 76 | IdleTimeout: 2 * time.Minute, // Short idle |
| 77 | }, |
| 78 | ModeNormal: { |
| 79 | Name: "Normal Mode", |
| 80 | LambdaTimeout: 600, // 10 minutes - balanced |
| 81 | LambdaMemory: 256, // Balanced memory |
| 82 | SessionTTL: 8 * time.Minute, // 8 min sessions |
| 83 | OverlapWindow: 90 * time.Second, // 1.5 min overlap |
| 84 | DrainTimeout: 45 * time.Second, // Moderate drain |
| 85 | BufferSize: 32 * 1024, // 32KB buffers |
| 86 | MaxStreams: 500, // Good stream count |
| 87 | KeepAlive: 30 * time.Second, // Standard keep-alive |
| 88 | IdleTimeout: 5 * time.Minute, // Standard idle |
| 89 | }, |
| 90 | ModePerformance: { |
| 91 | Name: "Performance Mode", |
| 92 | LambdaTimeout: 900, // 15 minutes - maximum |
| 93 | LambdaMemory: 512, // High memory |
| 94 | SessionTTL: 12 * time.Minute, // 12 min sessions |
| 95 | OverlapWindow: 2 * time.Minute, // 2 min overlap |
| 96 | DrainTimeout: 60 * time.Second, // Full drain time |
| 97 | BufferSize: 64 * 1024, // 64KB buffers |
| 98 | MaxStreams: 1000, // Maximum streams |
| 99 | KeepAlive: 30 * time.Second, // Optimal keep-alive |
| 100 | IdleTimeout: 5 * time.Minute, // Optimal idle |
| 101 | }, |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // New creates a new configuration with defaults from environment variables |
| 106 | func New() *Config { |
no outgoing calls
no test coverage detected