vexp-mcp 3.3.4 → 3.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/index-status.js +30 -2
- package/package.json +1 -1
|
@@ -116,8 +116,12 @@ function formatStatusAsText(status, targeting) {
|
|
|
116
116
|
lines.push(`| Total edges | ${status.total_edges.toLocaleString()} |`);
|
|
117
117
|
lines.push(`| Total files | ${status.total_files.toLocaleString()} |`);
|
|
118
118
|
lines.push(`| Cross-repo edges | ${status.cross_repo_edges.toLocaleString()} |`);
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
// Older daemons sent 0 for every index: no row rather than "0 B".
|
|
120
|
+
if ((status.db_size_bytes ?? 0) > 0)
|
|
121
|
+
lines.push(`| Index DB size | ${formatBytes(status.db_size_bytes)} |`);
|
|
122
|
+
const memory = daemonMemory(status);
|
|
123
|
+
if (memory)
|
|
124
|
+
lines.push(`| Daemon memory | ${memory} |`);
|
|
121
125
|
if (status.compressor) {
|
|
122
126
|
const compressorLabel = status.compressor === "llm"
|
|
123
127
|
? `llm (${status.llm_model ?? "?"}, ${status.llm_inference ?? "?"})`
|
|
@@ -226,6 +230,30 @@ function formatUptime(seconds) {
|
|
|
226
230
|
const m = Math.floor((seconds % 3600) / 60);
|
|
227
231
|
return `${h}h ${m}m`;
|
|
228
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* How far the resident set has to exceed the daemon's own memory before both
|
|
235
|
+
* are given. Same threshold as `vexp daemons` (process_memory.rs
|
|
236
|
+
* MAPPED_WORTH_SAYING).
|
|
237
|
+
*/
|
|
238
|
+
const MAPPED_WORTH_SAYING = 256 * 1024 * 1024;
|
|
239
|
+
/**
|
|
240
|
+
* The daemon's memory as the status table gives it: what it holds itself,
|
|
241
|
+
* and beside it the resident set when the pages of mapped files make the two
|
|
242
|
+
* far apart. With the local LLM on, the model's pages put a daemon whose own
|
|
243
|
+
* footprint was 127 MB at 3.3 GB resident (field report, 2026-10-14). A
|
|
244
|
+
* daemon that sends neither figure (older ones sent a 0 placeholder) gets no
|
|
245
|
+
* row: "0 B" read as a measurement.
|
|
246
|
+
*/
|
|
247
|
+
export function daemonMemory(status) {
|
|
248
|
+
const own = (status.memory_bytes ?? 0) > 0 ? status.memory_bytes : undefined;
|
|
249
|
+
const rss = (status.memory_rss_bytes ?? 0) > 0 ? status.memory_rss_bytes : undefined;
|
|
250
|
+
if (own === undefined)
|
|
251
|
+
return rss === undefined ? undefined : formatBytes(rss);
|
|
252
|
+
if (rss !== undefined && rss >= own + MAPPED_WORTH_SAYING) {
|
|
253
|
+
return `${formatBytes(own)} (${formatBytes(rss)} with mapped files)`;
|
|
254
|
+
}
|
|
255
|
+
return formatBytes(own);
|
|
256
|
+
}
|
|
229
257
|
function formatBytes(bytes) {
|
|
230
258
|
if (bytes < 1024)
|
|
231
259
|
return `${bytes} B`;
|