Пример #1
0
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
}
Пример #2
0
func (rc *realCache) newContainerElement() *containerElement {
	return &containerElement{
		metrics: store.NewGCStore(store.NewTimeStore(), rc.bufferDuration),
	}
}