Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accurate hit/miss counter #44

Merged
merged 2 commits into from
Aug 21, 2024
Merged

accurate hit/miss counter #44

merged 2 commits into from
Aug 21, 2024

Conversation

Yiling-J
Copy link
Owner

Current counter is inaccurate because it only counts items in the read buffer, and add wrong size. But the overall hit ratio trend is still correct. The hit ratio is used in policy to make it adaptive.

To reuse the counters in the stats API, they should be accurate. This PR updates the counter directly in the API rather than in the buffer. Additionally, it changes the total to miss to reduce contention.

Throughput and hit ratio performance should remain unchanged (tested).

@Yiling-J Yiling-J merged commit bcfb834 into main Aug 21, 2024
68 checks passed
@Yiling-J Yiling-J mentioned this pull request Aug 22, 2024
@Yiling-J Yiling-J deleted the fix/incorrect_total_count branch October 18, 2024 03:08
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.

1 participant