@@ -206,26 +206,26 @@ func DefaultConfig() *Config {
206206 LogLevel : 1 ,
207207
208208 // Connection Handoff Configuration
209- MaxHandoffRetries : 3 ,
210- HandoffQueueTimeout : 5 * time .Second ,
211- HandoffRetryDelay : 1 * time .Second ,
209+ MaxHandoffRetries : 3 ,
210+ HandoffQueueTimeout : 5 * time .Second ,
211+ HandoffRetryDelay : 1 * time .Second ,
212212
213213 // Worker Scaling Configuration
214- WorkerScaleDownDelay : 30 * time .Second ,
215- WorkerScaleUpDelay : 5 * time .Second ,
216- WorkerIdleTimeout : 60 * time .Second ,
214+ WorkerScaleDownDelay : 30 * time .Second ,
215+ WorkerScaleUpDelay : 5 * time .Second ,
216+ WorkerIdleTimeout : 60 * time .Second ,
217217
218218 // Connection Validation Configuration
219- ConnectionValidationTimeout : 2 * time .Second ,
220- ConnectionHealthCheckInterval : 10 * time .Second ,
219+ ConnectionValidationTimeout : 2 * time .Second ,
220+ ConnectionHealthCheckInterval : 10 * time .Second ,
221221
222222 // Operation Tracking Configuration
223223 OperationCleanupInterval : 5 * time .Minute ,
224224 MaxActiveOperations : 10000 ,
225225
226226 // Notification Processing Configuration
227- NotificationBufferSize : 1000 ,
228- NotificationTimeout : 1 * time .Second ,
227+ NotificationBufferSize : 1000 ,
228+ NotificationTimeout : 1 * time .Second ,
229229 }
230230}
231231
@@ -318,90 +318,6 @@ func (c *Config) Validate() error {
318318 return nil
319319}
320320
321- // ProductionConfig returns a Config optimized for production environments.
322- // This configuration is tuned for high-load scenarios with enhanced reliability.
323- func ProductionConfig () * Config {
324- return & Config {
325- // Basic settings
326- Enabled : MaintNotificationsEnabled ,
327- EndpointType : EndpointTypeAuto ,
328- RelaxedTimeout : 45 * time .Second ,
329- HandoffTimeout : 20 * time .Second ,
330- PostHandoffRelaxedDuration : 15 * time .Second ,
331-
332- // Enhanced performance settings for production
333- MaxHandoffRetries : 5 ,
334- HandoffQueueTimeout : 10 * time .Second ,
335- HandoffRetryDelay : 2 * time .Second ,
336-
337- // Worker scaling for high load
338- MinWorkers : 8 ,
339- MaxWorkers : 64 ,
340- HandoffQueueSize : 2000 ,
341- WorkerScaleDownDelay : 60 * time .Second ,
342- WorkerScaleUpDelay : 3 * time .Second ,
343- WorkerIdleTimeout : 120 * time .Second ,
344-
345- // Connection management
346- ConnectionValidationTimeout : 3 * time .Second ,
347- ConnectionHealthCheckInterval : 30 * time .Second ,
348-
349- // Operation management for high throughput
350- OperationCleanupInterval : 2 * time .Minute ,
351- MaxActiveOperations : 50000 ,
352-
353- // Monitoring and observability
354- LogLevel : 1 , // Warnings and errors
355- NotificationBufferSize : 5000 ,
356- NotificationTimeout : 2 * time .Second ,
357-
358- // Existing fields
359- ScaleDownDelay : 2 * time .Second ,
360- }
361- }
362-
363- // DevelopmentConfig returns a Config optimized for development environments.
364- // This configuration prioritizes debugging and has conservative resource usage.
365- func DevelopmentConfig () * Config {
366- return & Config {
367- // Basic settings
368- Enabled : MaintNotificationsAuto ,
369- EndpointType : EndpointTypeAuto ,
370- RelaxedTimeout : 10 * time .Second ,
371- HandoffTimeout : 5 * time .Second ,
372- PostHandoffRelaxedDuration : 3 * time .Second ,
373-
374- // Conservative performance settings
375- MaxHandoffRetries : 3 ,
376- HandoffQueueTimeout : 5 * time .Second ,
377- HandoffRetryDelay : 1 * time .Second ,
378-
379- // Minimal worker scaling
380- MinWorkers : 2 ,
381- MaxWorkers : 8 ,
382- HandoffQueueSize : 100 ,
383- WorkerScaleDownDelay : 30 * time .Second ,
384- WorkerScaleUpDelay : 5 * time .Second ,
385- WorkerIdleTimeout : 60 * time .Second ,
386-
387- // Connection management
388- ConnectionValidationTimeout : 2 * time .Second ,
389- ConnectionHealthCheckInterval : 10 * time .Second ,
390-
391- // Frequent cleanup for testing
392- OperationCleanupInterval : 30 * time .Second ,
393- MaxActiveOperations : 1000 ,
394-
395- // Verbose logging for debugging
396- LogLevel : 3 , // Debug level
397- NotificationBufferSize : 100 ,
398- NotificationTimeout : 1 * time .Second ,
399-
400- // Existing fields
401- ScaleDownDelay : 2 * time .Second ,
402- }
403- }
404-
405321// ApplyDefaults applies default values to any zero-value fields in the configuration.
406322// This ensures that partially configured structs get sensible defaults for missing fields.
407323func (c * Config ) ApplyDefaults () * Config {
@@ -579,18 +495,18 @@ func (c *Config) Clone() *Config {
579495 LogLevel : c .LogLevel ,
580496
581497 // New configuration fields
582- MaxHandoffRetries : c .MaxHandoffRetries ,
583- HandoffQueueTimeout : c .HandoffQueueTimeout ,
584- HandoffRetryDelay : c .HandoffRetryDelay ,
585- WorkerScaleDownDelay : c .WorkerScaleDownDelay ,
586- WorkerScaleUpDelay : c .WorkerScaleUpDelay ,
587- WorkerIdleTimeout : c .WorkerIdleTimeout ,
588- ConnectionValidationTimeout : c .ConnectionValidationTimeout ,
589- ConnectionHealthCheckInterval : c .ConnectionHealthCheckInterval ,
590- OperationCleanupInterval : c .OperationCleanupInterval ,
591- MaxActiveOperations : c .MaxActiveOperations ,
592- NotificationBufferSize : c .NotificationBufferSize ,
593- NotificationTimeout : c .NotificationTimeout ,
498+ MaxHandoffRetries : c .MaxHandoffRetries ,
499+ HandoffQueueTimeout : c .HandoffQueueTimeout ,
500+ HandoffRetryDelay : c .HandoffRetryDelay ,
501+ WorkerScaleDownDelay : c .WorkerScaleDownDelay ,
502+ WorkerScaleUpDelay : c .WorkerScaleUpDelay ,
503+ WorkerIdleTimeout : c .WorkerIdleTimeout ,
504+ ConnectionValidationTimeout : c .ConnectionValidationTimeout ,
505+ ConnectionHealthCheckInterval : c .ConnectionHealthCheckInterval ,
506+ OperationCleanupInterval : c .OperationCleanupInterval ,
507+ MaxActiveOperations : c .MaxActiveOperations ,
508+ NotificationBufferSize : c .NotificationBufferSize ,
509+ NotificationTimeout : c .NotificationTimeout ,
594510 }
595511}
596512
0 commit comments