Skip to content

Commit

Permalink
fix: correct the name of the rejection counter
Browse files Browse the repository at this point in the history
  • Loading branch information
maypok86 committed Sep 15, 2024
1 parent 8e6a214 commit afabc31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stats/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Counter struct {
misses *xsync.Adder
evictions *xsync.Adder
evictionWeight *xsync.Adder
rejectedSets *xsync.Adder
rejections *xsync.Adder
loadSuccesses *xsync.Adder
loadFailures *xsync.Adder
totalLoadTime *xsync.Adder
Expand All @@ -40,7 +40,7 @@ func NewCounter() *Counter {
misses: xsync.NewAdder(),
evictions: xsync.NewAdder(),
evictionWeight: xsync.NewAdder(),
rejectedSets: xsync.NewAdder(),
rejections: xsync.NewAdder(),
loadSuccesses: xsync.NewAdder(),
loadFailures: xsync.NewAdder(),
totalLoadTime: xsync.NewAdder(),
Expand All @@ -62,7 +62,7 @@ func (c *Counter) Snapshot() Stats {
misses: c.misses.Value(),
evictions: c.evictions.Value(),
evictionWeight: c.evictionWeight.Value(),
rejections: c.rejectedSets.Value(),
rejections: c.rejections.Value(),
loadSuccesses: c.loadSuccesses.Value(),
loadFailures: c.loadFailures.Value(),
//nolint:gosec // overflow is handled above
Expand Down Expand Up @@ -93,7 +93,7 @@ func (c *Counter) RecordEviction(weight uint32) {
// RecordRejections records rejections of entries. Cache rejects entries only if they have too much weight.
func (c *Counter) RecordRejections(count int) {
//nolint:gosec // there is no overflow
c.rejectedSets.Add(uint64(count))
c.rejections.Add(uint64(count))
}

// RecordLoadSuccess records the successful load of a new entry. This method should be called when a cache request
Expand Down

0 comments on commit afabc31

Please sign in to comment.