Skip to content

Conversation

@deckarep
Copy link
Contributor

  • Simplifying logic that's duplicated
  • Makes stats consistent with how they're getting cleared and locates them to a single method.

segment.go Outdated
atomic.StoreInt64(&seg.missCount, 0)
atomic.StoreInt64(&seg.overwrites, 0)
atomic.StoreInt64(&seg.totalCount, 0)
atomic.StoreInt64(&seg.totalTime, 0)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totalTime and totalCount is not stats.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When Cache.ResetStatistics is called, we don't want to change them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for pointing that out. I will follow up with a fix.

@deckarep
Copy link
Contributor Author

@coocood - ok, finally got around to making the change. Please review and thank you.

atomic.StoreInt64(&seg.totalEvacuate, 0)
atomic.StoreInt64(&seg.totalExpired, 0)
atomic.StoreInt64(&seg.overwrites, 0)
atomic.StoreInt64(&seg.entryCount, 0)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants