summaryrefslogtreecommitdiff
path: root/src/mcp/tools/get_system_health.c
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-07-04 18:44:17 +0900
committertanaka takashi <isazaka@gmail.com>2026-07-04 18:44:17 +0900
commit751999a82b8854ef5231e0ded5fe022b1ea5d8ff (patch)
treed09653d2955f0f5354e9ef76f9bc550fb8f0732a /src/mcp/tools/get_system_health.c
parent21dda921887da2515d1eba0d3d26e2036bf9f7f7 (diff)
Harden backup import and restore coverage
Diffstat (limited to 'src/mcp/tools/get_system_health.c')
-rw-r--r--src/mcp/tools/get_system_health.c19
1 files changed, 19 insertions, 0 deletions
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\":");