func addOrUpdateEvent(newEvent *api.Event) history {
	key := getEventKey(newEvent)
	previousEvents.Lock()
	defer previousEvents.Unlock()
	previousEvents.cache.Add(
		key,
		history{
			Count:           newEvent.Count,
			FirstTimestamp:  newEvent.FirstTimestamp,
			Name:            newEvent.Name,
			ResourceVersion: newEvent.ResourceVersion,
		})
	return getEventFromCache(key)
}
addOrUpdateEvent creates a new entry for the given event in the previous events hash table if the event
doesn't already exist, otherwise it updates the existing entry.
package record
import (
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
	"github.com/golang/groupcache/lru"
	"sync"
)
type history struct {
	Count int
	FirstTimestamp util.Time
	Name string
	ResourceVersion string
}
const (
	maxLruCacheEntries = 4096
)
type historyCache struct {
	sync.RWMutex
	cache *lru.Cache
}
var previousEvents = historyCache{cache: lru.New(maxLruCacheEntries)}