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

Fix cache panel miss counting #1629

Merged
merged 1 commit into from
May 24, 2022

Conversation

living180
Copy link
Contributor

The cache panel was not counting misses for the get_many() cache method, because it assumed that all keys would be present in the returned dict (with a value of None if not present in the cache) while in reality only keys present in the cache are present in the returned dict. Correct the miss counting logic, and add a test for tracking hits and misses.

Copy link
Member

@tim-schilling tim-schilling left a comment

Choose a reason for hiding this comment

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

Makes sense

@tim-schilling
Copy link
Member

@living180 looks like using github's conflict resolver didn't go well. I'll get that cleaned up.

@living180 living180 force-pushed the cache_miss_counting branch from dcecbaf to b7c490a Compare May 24, 2022 13:28
The cache panel was not counting misses for the get_many() cache method,
because it assumed that all keys would be present in the returned dict
(with a value of None if not present in the cache) while in reality only
keys present in the cache are present in the returned dict.  Correct the
miss counting logic, and add a test for tracking hits and misses.
@tim-schilling tim-schilling force-pushed the cache_miss_counting branch from b7c490a to 813cfbf Compare May 24, 2022 13:29
@tim-schilling tim-schilling merged commit 813cfbf into django-commons:main May 24, 2022
@living180 living180 deleted the cache_miss_counting branch May 29, 2022 13:38
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