Skip to content

Commit

Permalink
make cache size larger than we would expect to be filled
Browse files Browse the repository at this point in the history
  • Loading branch information
crockeo committed Jun 21, 2023
1 parent 4604e4c commit 0b47ff3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,10 @@ type StatGenerator interface {
// NewStore returns an Empty store that flushes to Sink passed as an argument.
// Note: the export argument is unused.
func NewStore(sink Sink, _ bool) Store {
// TODO(crockeo): decide how this should be configurable
cacheSize := 8192

s := &statStore{sink: sink}

// lru.NewWithEvict can only return a non-nil error when cacheSize < 0.
cacheSize := 65536
s.counters, _ = lru.NewWithEvict(cacheSize, s.flushCounter)
s.timers, _ = lru.New[string, *timer](cacheSize)

Expand Down

0 comments on commit 0b47ff3

Please sign in to comment.