From 751999a82b8854ef5231e0ded5fe022b1ea5d8ff Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 4 Jul 2026 18:44:17 +0900 Subject: Harden backup import and restore coverage --- src/mcp/tools/get_system_health.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/mcp/tools/get_system_health.c') diff --git a/src/mcp/tools/get_system_health.c b/src/mcp/tools/get_system_health.c index f84511f..893a3b1 100644 --- a/src/mcp/tools/get_system_health.c +++ b/src/mcp/tools/get_system_health.c @@ -35,6 +35,25 @@ call_get_system_health(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_json_u64(&json, health.update_records); tiny_json_raw(&json, ",\"dead_bytes\":"); tiny_json_u64(&json, health.dead_bytes); + tiny_json_raw(&json, ",\"memory_estimate\":{\"total_bytes\":"); + tiny_json_u64(&json, + health.memory_entry_bytes + health.memory_body_bytes + health.memory_metadata_bytes + + tiny_search_index_memory_estimate(context->search_index) + + tiny_history_index_memory_estimate(context->history_index) + + tiny_memory_index_memory_estimate(context->memory_index)); + tiny_json_raw(&json, ",\"store_entries_bytes\":"); + tiny_json_u64(&json, health.memory_entry_bytes); + tiny_json_raw(&json, ",\"body_bytes\":"); + tiny_json_u64(&json, health.memory_body_bytes); + tiny_json_raw(&json, ",\"metadata_bytes\":"); + tiny_json_u64(&json, health.memory_metadata_bytes); + tiny_json_raw(&json, ",\"search_index_bytes\":"); + tiny_json_u64(&json, tiny_search_index_memory_estimate(context->search_index)); + tiny_json_raw(&json, ",\"history_index_bytes\":"); + tiny_json_u64(&json, tiny_history_index_memory_estimate(context->history_index)); + tiny_json_raw(&json, ",\"relation_index_bytes\":"); + tiny_json_u64(&json, tiny_memory_index_memory_estimate(context->memory_index)); + tiny_json_raw(&json, "}"); tiny_json_raw(&json, ",\"io\":{\"write_bytes\":"); tiny_json_u64(&json, health.write_bytes); tiny_json_raw(&json, ",\"write_calls\":"); -- cgit v1.2.3