Read counters without allocating memory.
More...
Read counters without allocating memory.
◆ mcp_arena_high_water()
| size_t mcp_arena_high_water |
( |
void | | ) |
|
|
extern |
Read the arena's recorded high-water mark.
- Returns
- Peak recorded bytes for parsing, callback storage and serialized output. Exhaustion may record the whole configured capacity.
Persists across requests and free_tools(); no reset API.
- Example
size_t mcp_arena_high_water(void)
Read the arena's recorded high-water mark.
◆ mcp_arena_used()
| size_t mcp_arena_used |
( |
void | | ) |
|
|
extern |
Read current arena consumption, including alignment padding.
- Returns
- Bytes in use; zero after dispatch returns.
- Example
size_t mcp_arena_used(void)
Read current arena consumption, including alignment padding.
◆ mcp_heap_allocations()
| size_t mcp_heap_allocations |
( |
void | | ) |
|
|
extern |
Count allocation attempts through the installed cJSON heap allocator.
- Returns
- Cumulative cJSON heap-allocation attempts outside dispatch.
Not a byte count or a count of every allocation. Direct malloc calls for registry nodes are not included; failed cJSON allocations are counted. Requests should not increase this counter after mcp_prepare() succeeds.
- Example
dispatch(
"{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"ping\"}", 0);
size_t mcp_heap_allocations(void)
Count allocation attempts through the installed cJSON heap allocator.
void dispatch(const char *line, int fd)
Dispatch one JSON-RPC message through the default transport hook.
◆ mcp_resource_index_height()
| size_t mcp_resource_index_height |
( |
void | | ) |
|
|
extern |
Read the height of the resource-URI lookup index for diagnostics.
- Returns
- Node levels; zero when empty or VFS is disabled.
- Example
size_t mcp_resource_index_height(void)
Read the height of the resource-URI lookup index for diagnostics.
◆ mcp_resource_lookup_steps()
| size_t mcp_resource_lookup_steps |
( |
void | | ) |
|
|
extern |
Read the comparison count of the latest resources/read lookup.
- Returns
- Comparisons; zero before a read, after free_tools() or with VFS disabled.
- Example
size_t mcp_resource_lookup_steps(void)
Read the comparison count of the latest resources/read lookup.
◆ mcp_tool_index_height()
| size_t mcp_tool_index_height |
( |
void | | ) |
|
|
extern |
Read the height of the tool-name lookup index for diagnostics.
- Returns
- Node levels; zero when empty, one for a single tool.
- Example
size_t mcp_tool_index_height(void)
Read the height of the tool-name lookup index for diagnostics.
◆ mcp_tool_lookup_steps()
| size_t mcp_tool_lookup_steps |
( |
void | | ) |
|
|
extern |
Read the comparison count of the latest tool-name lookup.
- Returns
- Number of string comparisons; zero for a NULL lookup or empty index.
Registration and tools/call also perform lookups and can update it.
- Example
struct tool *tool =
find_tool(
"setIndicator");
size_t mcp_tool_lookup_steps(void)
Read the comparison count of the latest tool-name lookup.