func NewCache(bufferDuration, gcDuration time.Duration) Cache { rc := &realCache{ pods: make(map[string]*podElement), nodes: make(map[string]*nodeElement), events: store.NewGCStore(store.NewTimeStore(), bufferDuration), eventUIDs: make(map[string]struct{}), bufferDuration: bufferDuration, } go util.Until(rc.runGC, gcDuration, util.NeverStop) return rc }
func (rc *realCache) newContainerElement() *containerElement { return &containerElement{ metrics: store.NewGCStore(store.NewTimeStore(), rc.bufferDuration), } }