fix(receiver/memcached): report hit ratio, not miss ratio#49470
Open
ogulcanaydogan wants to merge 2 commits into
Open
fix(receiver/memcached): report hit ratio, not miss ratio#49470ogulcanaydogan wants to merge 2 commits into
ogulcanaydogan wants to merge 2 commits into
Conversation
calculateHitRatio was declared as (misses, hits) but every call site passes (hits, misses), so memcached.operation_hit_ratio emitted misses/(hits+misses). Align the parameter order with the callers and add a unit test covering the ratio. Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@gmail.com>
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@gmail.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
memcached.operation_hit_ratio was reporting the miss ratio instead of the hit ratio. calculateHitRatio
was declared as (misses, hits) but every call site passes (hits, misses), so it computed misses / (hits + misses). This aligns the parameter order with the callers so the metric reports hits / (hits +
misses).
Link to tracking issue
None; found while reading the receiver code.
Testing
Added a unit test for calculateHitRatio covering all-hits, all-misses, a mixed case, and zero
operations. The existing scraper test still passes.
Documentation
No documentation changes; the metric is already documented as a hit ratio.