已合并
fix: 修正 /metrics 与 /metrics/summary 文档描述 #521
fix: 修正 /metrics 与 /metrics/summary 文档描述 #521
已合并
wangyibing创建于 12 天前
1 个文件变更+11-7
@@ -422,8 +422,10 @@ memcache_ubs_io_disk_total_bandwidth_bytes_per_sec{rank="0",disk_path="/data/dis
422| `memcache_<op>_not_found_total` | counter | — | `MmcMetaMetricSnapshot::<op>NotFoundCount` | `<op>` 未命中次数(`MMC_UNMATCHED_KEY`),不计入 failure;仅 `get`/`batch_get`/`remove`/`batch_remove`/`update_state`/`batch_update_state`/`query`/`batch_query`/`exist_key`/`batch_exist_key` 输出;支持 per-rank |422| `memcache_<op>_not_found_total` | counter | — | `MmcMetaMetricSnapshot::<op>NotFoundCount` | `<op>` 未命中次数(`MMC_UNMATCHED_KEY`),不计入 failure;仅 `get`/`batch_get`/`remove`/`batch_remove`/`update_state`/`batch_update_state`/`query`/`batch_query`/`exist_key`/`batch_exist_key` 输出;支持 per-rank |
423| `memcache_evict_operations_total` | counter | — | `MmcMetaMetricSnapshot::evictCount` | 驱逐操作总数;支持 per-rank |423| `memcache_evict_operations_total` | counter | — | `MmcMetaMetricSnapshot::evictCount` | 驱逐操作总数;支持 per-rank |
424| `memcache_evict_running` | gauge | — | `MmcMetaManager::evictCheck_` | 是否正在执行淘汰(GC)(1=是,0=否) |424| `memcache_evict_running` | gauge | — | `MmcMetaManager::evictCheck_` | 是否正在执行淘汰(GC)(1=是,0=否) |
425-| `memcache_get_hits_dram_total` | counter | — | `MmcMetaMetricSnapshot::getHitDramCount` | 命中 DRAMGet 数;支持 per-rank |425+| `memcache_flush_blobs_total` | counter | — | `MmcMetaMetricSnapshot::asyncFlushBlobAdded` | 异步 flush 写入 SSD blob 数;支持 per-rank |
426-| `memcache_get_hits_ssd_total` | counter | — | `MmcMetaMetricSnapshot::getHitSsdCount` | 命中 SSD(触发回温)的 Get 数;支持 per-rank |426+| `memcache_flush_bytes_total` | counter | — | `MmcMetaMetricSnapshot::asyncFlushBlobBytes` | 异步 flush 写入 SSD 的字节总数;支持 per-rank |
427+| `memcache_get_hits_dram_total` | counter | — | `MmcMetaMetricSnapshot::getHitDramCount` | Get 直接命中可读块(HBM/DRAM)返回的 key 数,不触发回温;支持 per-rank |
428+| `memcache_get_hits_ssd_total` | counter | — | `MmcMetaMetricSnapshot::getHitSsdCount` | Get 命中 SSD 且回温成功后由回温目标块返回的 key 数;回温失败不计入(计入 `rewarm_failed_total`);支持 per-rank |
427| `memcache_rewarm_total` | counter | — | `MmcMetaMetricSnapshot::rewarmCount` | SSD→DRAM 回温操作总数;支持 per-rank |429| `memcache_rewarm_total` | counter | — | `MmcMetaMetricSnapshot::rewarmCount` | SSD→DRAM 回温操作总数;支持 per-rank |
428| `memcache_rewarm_failed_total` | counter | — | `MmcMetaMetricSnapshot::rewarmFailCount` | 失败的回温操作数;支持 per-rank |430| `memcache_rewarm_failed_total` | counter | — | `MmcMetaMetricSnapshot::rewarmFailCount` | 失败的回温操作数;支持 per-rank |
429| `memcache_rewarm_bytes_total` | counter | — | `MmcMetaMetricSnapshot::rewarmBytesCount` | 累计回温字节数;支持 per-rank |431| `memcache_rewarm_bytes_total` | counter | — | `MmcMetaMetricSnapshot::rewarmBytesCount` | 累计回温字节数;支持 per-rank |
@@ -501,7 +503,7 @@ curl "http://127.0.0.1:8000/metrics/summary"
501`text/plain; charset=utf-8`503`text/plain; charset=utf-8`
502 504 
503```text505```text
504-keys=2 evict=0 rewarm=0 rewarm_fail=0 rewarm_bytes_total=0 rewarm_bytes_current=0 get_hit_dram=0 get_hit_ssd=0 hbm_used=368640/5368709120 dram_used=0/5368709120 ssd_used=0/0 alloc_req=68 alloc_success=68 alloc_fail=0 batch_alloc_req=0 batch_alloc_success=0 batch_alloc_fail=0 get_req=68 get_success=68 get_fail=0 get_not_found=0 batch_get_req=0 batch_get_success=0 batch_get_fail=0 batch_get_not_found=0 remove_req=0 remove_success=0 remove_fail=0 remove_not_found=0 batch_remove_req=0 batch_remove_success=0 batch_remove_fail=0 batch_remove_not_found=0 remove_all_req=0 remove_all_success=0 remove_all_fail=0 update_state_req=0 update_state_success=0 update_state_fail=0 update_state_not_found=0 batch_update_state_req=0 batch_update_state_success=0 batch_update_state_fail=0 batch_update_state_not_found=0 query_req=12 query_success=11 query_fail=0 query_not_found=1 batch_query_req=3 batch_query_success=3 batch_query_fail=0 batch_query_not_found=1 get_all_keys_req=4 get_all_keys_success=4 get_all_keys_fail=0 exist_key_req=0 exist_key_success=0 exist_key_fail=0 exist_key_not_found=0 batch_exist_key_req=0 batch_exist_key_success=0 batch_exist_key_fail=0 batch_exist_key_not_found=0 mount_req=0 mount_success=0 mount_fail=0 unmount_req=0 unmount_success=0 unmount_fail=0506+keys=2 evict=0 rewarm=0 rewarm_fail=0 rewarm_bytes_total=0 rewarm_bytes_current=0 flush_blobs=0 flush_bytes=0 get_hit_dram=0 get_hit_ssd=0 hbm_used=368640/5368709120 dram_used=0/5368709120 ssd_used=0/0 alloc_req=68 alloc_success=68 alloc_fail=0 batch_alloc_req=0 batch_alloc_success=0 batch_alloc_fail=0 get_req=68 get_success=68 get_fail=0 get_not_found=0 batch_get_req=0 batch_get_success=0 batch_get_fail=0 batch_get_not_found=0 remove_req=0 remove_success=0 remove_fail=0 remove_not_found=0 batch_remove_req=0 batch_remove_success=0 batch_remove_fail=0 batch_remove_not_found=0 remove_all_req=0 remove_all_success=0 remove_all_fail=0 update_state_req=0 update_state_success=0 update_state_fail=0 update_state_not_found=0 batch_update_state_req=0 batch_update_state_success=0 batch_update_state_fail=0 batch_update_state_not_found=0 query_req=12 query_success=11 query_fail=0 query_not_found=1 batch_query_req=3 batch_query_success=3 batch_query_fail=0 batch_query_not_found=1 get_all_keys_req=4 get_all_keys_success=4 get_all_keys_fail=0 exist_key_req=0 exist_key_success=0 exist_key_fail=0 exist_key_not_found=0 batch_exist_key_req=0 batch_exist_key_success=0 batch_exist_key_fail=0 batch_exist_key_not_found=0 mount_req=0 mount_success=0 mount_fail=0 unmount_req=0 unmount_success=0 unmount_fail=0
505```507```
506 508 
507**解释**509**解释**
@@ -511,9 +513,9 @@ keys=2 evict=0 rewarm=0 rewarm_fail=0 rewarm_bytes_total=0 rewarm_bytes_current=
511| 单行文本 | 成功时必须为单行,不能换行拆分 | 接口成功返回约定 |513| 单行文本 | 成功时必须为单行,不能换行拆分 | 接口成功返回约定 |
512| 格式 | 以空格分隔的 `key=value` 串,字段顺序固定 | 统计摘要接口契约 |514| 格式 | 以空格分隔的 `key=value` 串,字段顺序固定 | 统计摘要接口契约 |
513| 成功示例字段 | 成功示例应包含当前约定的全部字段 | 统计摘要接口契约 |515| 成功示例字段 | 成功示例应包含当前约定的全部字段 | 统计摘要接口契约 |
514-| 字段顺序固定 | 依次为 `keys`、`evict`、`rewarm`、`rewarm_fail`、`rewarm_bytes_total`、`rewarm_bytes_current`、`get_hit_dram`、`get_hit_ssd`、`hbm_used`、`dram_used`、`ssd_used`、`alloc_req`、`alloc_success`、`alloc_fail`、`batch_alloc_req`、`batch_alloc_success`、`batch_alloc_fail`、`get_req`、`get_success`、`get_fail`、`get_not_found`、`batch_get_req`、`batch_get_success`、`batch_get_fail`、`batch_get_not_found`、`remove_req`、`remove_success`、`remove_fail`、`remove_not_found`、`batch_remove_req`、`batch_remove_success`、`batch_remove_fail`、`batch_remove_not_found`、`remove_all_req`、`remove_all_success`、`remove_all_fail`、`update_state_req`、`update_state_success`、`update_state_fail`、`update_state_not_found`、`batch_update_state_req`、`batch_update_state_success`、`batch_update_state_fail`、`batch_update_state_not_found`、`query_req`、`query_success`、`query_fail`、`query_not_found`、`batch_query_req`、`batch_query_success`、`batch_query_fail`、`batch_query_not_found`、`get_all_keys_req`、`get_all_keys_success`、`get_all_keys_fail`、`exist_key_req`、`exist_key_success`、`exist_key_fail`、`exist_key_not_found`、`batch_exist_key_req`、`batch_exist_key_success`、`batch_exist_key_fail`、`batch_exist_key_not_found`、`mount_req`、`mount_success`、`mount_fail`、`unmount_req`、`unmount_success`、`unmount_fail` | 统计摘要接口契约 |516+| 字段顺序固定 | 依次为 `keys`、`evict`、`rewarm`、`rewarm_fail`、`rewarm_bytes_total`、`rewarm_bytes_current`、`flush_blobs`、`flush_bytes`、`get_hit_dram`、`get_hit_ssd`、`hbm_used`、`dram_used`、`ssd_used`、`alloc_req`、`alloc_success`、`alloc_fail`、`batch_alloc_req`、`batch_alloc_success`、`batch_alloc_fail`、`get_req`、`get_success`、`get_fail`、`get_not_found`、`batch_get_req`、`batch_get_success`、`batch_get_fail`、`batch_get_not_found`、`remove_req`、`remove_success`、`remove_fail`、`remove_not_found`、`batch_remove_req`、`batch_remove_success`、`batch_remove_fail`、`batch_remove_not_found`、`remove_all_req`、`remove_all_success`、`remove_all_fail`、`update_state_req`、`update_state_success`、`update_state_fail`、`update_state_not_found`、`batch_update_state_req`、`batch_update_state_success`、`batch_update_state_fail`、`batch_update_state_not_found`、`query_req`、`query_success`、`query_fail`、`query_not_found`、`batch_query_req`、`batch_query_success`、`batch_query_fail`、`batch_query_not_found`、`get_all_keys_req`、`get_all_keys_success`、`get_all_keys_fail`、`exist_key_req`、`exist_key_success`、`exist_key_fail`、`exist_key_not_found`、`batch_exist_key_req`、`batch_exist_key_success`、`batch_exist_key_fail`、`batch_exist_key_not_found`、`mount_req`、`mount_success`、`mount_fail`、`unmount_req`、`unmount_success`、`unmount_fail` | 统计摘要接口契约 |
515| 容量字段 | `hbm_used` / `dram_used` / `ssd_used` 格式为 `used/total`;未配置 SSD 时 `ssd_used``0/0` | 统计摘要接口契约 |517| 容量字段 | `hbm_used` / `dram_used` / `ssd_used` 格式为 `used/total`;未配置 SSD 时 `ssd_used``0/0` | 统计摘要接口契约 |
516-| per-rank 字段 | 开启 `MmcMetaMetricManager::IsPerRankEnabled()` 时,在上述固定字段后以 `<base>_by_rank_<rank>=<val>` 形式追加 per-rank 字段(每个 rank 一项),覆盖驱逐/回温/命中 7 项:`evict_by_rank`、`get_hit_dram_by_rank`、`get_hit_ssd_by_rank`、`rewarm_by_rank`、`rewarm_fail_by_rank`、`rewarm_bytes_by_rank`、`rewarm_bytes_current_by_rank`;业务调用容量、`keys` 等不输出 per-rank 字段 | per-rank 统计契约 |518+| per-rank 字段 | 开启 `MmcMetaMetricManager::IsPerRankEnabled()` 时,在上述固定字段后以 `<base>_by_rank_<rank>=<val>` 形式追加 per-rank 字段(每个 rank 一项),覆盖驱逐/回温/flush/命中:`evict_by_rank`、`get_hit_dram_by_rank`、`get_hit_ssd_by_rank`、`rewarm_by_rank`、`rewarm_fail_by_rank`、`rewarm_bytes_by_rank`、`rewarm_bytes_current_by_rank`、`flush_blobs_by_rank`、`flush_bytes_by_rank`| per-rank 统计契约 |
517| 结果口径 | `*_success` 表示 `MMC_OK``*_fail` 表示真实错误(包括 `MMC_DUPLICATED_OBJECT`);`*_not_found` 表示 `MMC_UNMATCHED_KEY`,不计入 fail;Batch 字段为接口调用级统计,Batch 子项同时累计到对应非 Batch 字段;Batch 调用级统计中真实错误优先,只有无真实错误且存在子项 `MMC_UNMATCHED_KEY` 时才增加 Batch `*_not_found` | 统计摘要接口契约 |519| 结果口径 | `*_success` 表示 `MMC_OK``*_fail` 表示真实错误(包括 `MMC_DUPLICATED_OBJECT`);`*_not_found` 表示 `MMC_UNMATCHED_KEY`,不计入 fail;Batch 字段为接口调用级统计,Batch 子项同时累计到对应非 Batch 字段;Batch 调用级统计中真实错误优先,只有无真实错误且存在子项 `MMC_UNMATCHED_KEY` 时才增加 Batch `*_not_found` | 统计摘要接口契约 |
518| 占位值策略 | 当前无法提供真实值的字段仍保留在成功体中,可使用 `0``0/0` 或空值占位 | 降级规则 |520| 占位值策略 | 当前无法提供真实值的字段仍保留在成功体中,可使用 `0``0/0` 或空值占位 | 降级规则 |
519 521 
@@ -529,8 +531,10 @@ keys=2 evict=0 rewarm=0 rewarm_fail=0 rewarm_bytes_total=0 rewarm_bytes_current=
529| `rewarm_fail` | uint | `MmcMetaMetricSnapshot::rewarmFailCount` | 失败的回温操作数 |531| `rewarm_fail` | uint | `MmcMetaMetricSnapshot::rewarmFailCount` | 失败的回温操作数 |
530| `rewarm_bytes_total` | uint (bytes) | `MmcMetaMetricSnapshot::rewarmBytesCount` | 累计回温字节数 |532| `rewarm_bytes_total` | uint (bytes) | `MmcMetaMetricSnapshot::rewarmBytesCount` | 累计回温字节数 |
531| `rewarm_bytes_current` | uint (bytes) | `MmcMetaMetricSnapshot::rewarmBytesCurrent` | 当前在途回温字节数 |533| `rewarm_bytes_current` | uint (bytes) | `MmcMetaMetricSnapshot::rewarmBytesCurrent` | 当前在途回温字节数 |
532-| `get_hit_dram` | uint | `MmcMetaMetricSnapshot::getHitDramCount` | 命中 DRAMGet 数 |534+| `flush_blobs` | uint | `MmcMetaMetricSnapshot::asyncFlushBlobAdded` | 异步 flush 写入 SSD blob 数 |
533-| `get_hit_ssd` | uint | `MmcMetaMetricSnapshot::getHitSsdCount` | 命中 SSD(触发回温)的 Get 数 |535+| `flush_bytes` | uint (bytes) | `MmcMetaMetricSnapshot::asyncFlushBlobBytes` | 异步 flush 写入 SSD 的字节总数 |
536+| `get_hit_dram` | uint | `MmcMetaMetricSnapshot::getHitDramCount` | Get 直接命中可读块(HBM/DRAM)返回的 key 数,不触发回温 |
537+| `get_hit_ssd` | uint | `MmcMetaMetricSnapshot::getHitSsdCount` | Get 命中 SSD 且回温成功后由回温目标块返回的 key 数;回温失败不计入(计入 `rewarm_fail`) |
534| `hbm_used` | `used/total` (bytes) | `RestUsageSnapshot`(hbm) | HBM 已用/总容量 |538| `hbm_used` | `used/total` (bytes) | `RestUsageSnapshot`(hbm) | HBM 已用/总容量 |
535| `dram_used` | `used/total` (bytes) | `RestUsageSnapshot`(dram) | DRAM 已用/总容量 |539| `dram_used` | `used/total` (bytes) | `RestUsageSnapshot`(dram) | DRAM 已用/总容量 |
536| `ssd_used` | `used/total` (bytes) | `RestUsageSnapshot`(ssd) | SSD 已用/总容量;未配置 SSD 时为 `0/0` |540| `ssd_used` | `used/total` (bytes) | `RestUsageSnapshot`(ssd) | SSD 已用/总容量;未配置 SSD 时为 `0/0` |