Skip to content

fix(receiver/memcached): report hit ratio, not miss ratio#49470

Open
ogulcanaydogan wants to merge 2 commits into
open-telemetry:mainfrom
ogulcanaydogan:fix/memcached-hit-ratio
Open

fix(receiver/memcached): report hit ratio, not miss ratio#49470
ogulcanaydogan wants to merge 2 commits into
open-telemetry:mainfrom
ogulcanaydogan:fix/memcached-hit-ratio

Conversation

@ogulcanaydogan

@ogulcanaydogan ogulcanaydogan commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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.

  • I, a human, wrote this pull request description myself.

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>
@ogulcanaydogan ogulcanaydogan marked this pull request as ready for review July 4, 2026 23:04
@ogulcanaydogan ogulcanaydogan requested a review from a team as a code owner July 4, 2026 23:04
@ogulcanaydogan ogulcanaydogan requested a review from dehaansa July 4, 2026 23:04
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant