[PR #1261] [CLOSED] [bugfix] Metrics modifications: Deleting and adding some metrics #2114

Closed
opened 2026-10-29 21:32:53 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1261
Author: @Liziqi-77
Created: 12/23/2025
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (5)

📊 Changes

9 files changed (+92 additions, -278 deletions)

View changed files

📝 mooncake-store/include/client_service.h (+0 -5)
📝 mooncake-store/include/master_client.h (+0 -8)
📝 mooncake-store/include/master_metric_manager.h (+13 -43)
📝 mooncake-store/include/rpc_service.h (+0 -3)
📝 mooncake-store/src/master_client.cpp (+0 -11)
📝 mooncake-store/src/master_metric_manager.cpp (+28 -101)
📝 mooncake-store/src/master_service.cpp (+20 -35)
📝 mooncake-store/src/rpc_service.cpp (+0 -5)
📝 mooncake-store/tests/master_metrics_test.cpp (+31 -67)

📄 Description

Description

As mentioned in duplicate counts for mem_cache_hits and ssd_cache_hits, the current metrics have some issues, and this update will fix those issues.

Main modifications:

  • Delete the mem_cache_hits and ssd_cache_hits
  • Add a metric for calculating cache pool utilization.
  • Add the pool utilization rate to get_summary_string.

Since Mooncake can only perceive the key and not the request, it cannot calculate the true cache hit rate. Therefore, calculating it within the Conductor component is the most reasonable approach. The newly added metrics show the current usage rate of keys in the cache pool, and the update logic is as follows:

  • The total number of keys in the cache pool increases: PutEnd
  • The total number of cache pool keys decreases: BatchReplicaClear、Remove、RemoveByRegex、RemoveAll、BatchEvict
  • The number of cache pool keys used increases: GetReplicaListByRegex、GetReplicaList

Type of Change

  • Types
    • Bug fix
    • New feature
      • Transfer Engine
      • Mooncake Store
      • Mooncake EP
      • Integration
      • P2P Store
      • Python Wheel
    • Breaking change
    • CI/CD
    • Documentation update
    • Other

How Has This Been Tested?

Checklist

  • I have performed a self-review of my own code.
  • I have updated the documentation.
  • I have added tests to prove my changes are effective.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1261 **Author:** [@Liziqi-77](https://github.com/Liziqi-77) **Created:** 12/23/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (5) - [`e7a37d8`](https://github.com/kvcache-ai/Mooncake/commit/e7a37d83ec880c78a8c21b5a2750b3276d24e7fe) fix metrics - [`17aa975`](https://github.com/kvcache-ai/Mooncake/commit/17aa975662fae18fff00b82af4b40a87aa3be5cd) Delete invalid code - [`d24d99d`](https://github.com/kvcache-ai/Mooncake/commit/d24d99d30b9aed07b69310de63e4b439642ce153) Delete invalid code - [`e2e4562`](https://github.com/kvcache-ai/Mooncake/commit/e2e4562fa642f6a232bfd91a17bdddc3542779c2) fix format - [`ddf2645`](https://github.com/kvcache-ai/Mooncake/commit/ddf2645e44759caae81a69ec958af286b73c9c31) fix format ### 📊 Changes **9 files changed** (+92 additions, -278 deletions) <details> <summary>View changed files</summary> 📝 `mooncake-store/include/client_service.h` (+0 -5) 📝 `mooncake-store/include/master_client.h` (+0 -8) 📝 `mooncake-store/include/master_metric_manager.h` (+13 -43) 📝 `mooncake-store/include/rpc_service.h` (+0 -3) 📝 `mooncake-store/src/master_client.cpp` (+0 -11) 📝 `mooncake-store/src/master_metric_manager.cpp` (+28 -101) 📝 `mooncake-store/src/master_service.cpp` (+20 -35) 📝 `mooncake-store/src/rpc_service.cpp` (+0 -5) 📝 `mooncake-store/tests/master_metrics_test.cpp` (+31 -67) </details> ### 📄 Description ## Description <!-- A clear and concise description of the changes. Link to any relevant issues. --> As mentioned in [duplicate counts for mem_cache_hits and ssd_cache_hits](https://github.com/kvcache-ai/Mooncake/issues/1160), the current metrics have some issues, and this update will fix those issues. Main modifications: - Delete the mem_cache_hits and ssd_cache_hits - Add a metric for calculating cache pool utilization. - Add the pool utilization rate to get_summary_string. Since Mooncake can only perceive the key and not the request, it cannot calculate the true cache hit rate. Therefore, calculating it within the Conductor component is the most reasonable approach. The newly added metrics show the current usage rate of keys in the cache pool, and the update logic is as follows: - **The total number of keys in the cache pool increases:** PutEnd - **The total number of cache pool keys decreases:** BatchReplicaClear、Remove、RemoveByRegex、RemoveAll、BatchEvict - **The number of cache pool keys used increases:** GetReplicaListByRegex、GetReplicaList ## Type of Change * Types - [x] Bug fix - [ ] New feature - [ ] Transfer Engine - [ ] Mooncake Store - [ ] Mooncake EP - [ ] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [ ] Documentation update - [ ] Other ## How Has This Been Tested? <!-- Please describe the tests you've run to verify your changes. --> ## Checklist - [ ] I have performed a self-review of my own code. - [ ] I have updated the documentation. - [ ] I have added tests to prove my changes are effective. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:32:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2114
No description provided.