MCPcopy
hub / github.com/kubernetes/client-go / NewEventCorrelatorWithOptions

Function NewEventCorrelatorWithOptions

tools/record/events_cache.go:446–461  ·  view source on GitHub ↗
(options CorrelatorOptions)

Source from the content-addressed store, hash-verified

444}
445
446func 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
464func populateDefaults(options CorrelatorOptions) CorrelatorOptions {

Callers 1

StartRecordingToSinkMethod · 0.85

Calls 4

populateDefaultsFunction · 0.85
NewEventAggregatorFunction · 0.85
newEventLoggerFunction · 0.85

Tested by

no test coverage detected