(options CorrelatorOptions)
| 444 | } |
| 445 | |
| 446 | func NewEventCorrelatorWithOptions(options CorrelatorOptions) *EventCorrelator { |
| 447 | optionsWithDefaults := populateDefaults(options) |
| 448 | spamFilter := NewEventSourceObjectSpamFilter(optionsWithDefaults.LRUCacheSize, |
| 449 | optionsWithDefaults.BurstSize, optionsWithDefaults.QPS, optionsWithDefaults.Clock) |
| 450 | return &EventCorrelator{ |
| 451 | filterFunc: spamFilter.Filter, |
| 452 | aggregator: NewEventAggregator( |
| 453 | optionsWithDefaults.LRUCacheSize, |
| 454 | optionsWithDefaults.KeyFunc, |
| 455 | optionsWithDefaults.MessageFunc, |
| 456 | optionsWithDefaults.MaxEvents, |
| 457 | optionsWithDefaults.MaxIntervalInSeconds, |
| 458 | optionsWithDefaults.Clock), |
| 459 | logger: newEventLogger(optionsWithDefaults.LRUCacheSize, optionsWithDefaults.Clock), |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | // populateDefaults populates the zero value options with defaults |
| 464 | func populateDefaults(options CorrelatorOptions) CorrelatorOptions { |
no test coverage detected