MCPcopy Create free account
hub / github.com/garrytan/gstack / collectStructureStats

Function collectStructureStats

browse/src/memory-command.ts:20–30  ·  view source on GitHub ↗

* Assemble the MemoryStructureStats from the modules that own each buffer. * Browser-manager doesn't take a hard dep on every buffer-owning module — * the snapshot caller passes them in.

()

Source from the content-addressed store, hash-verified

18 * the snapshot caller passes them in.
19 */
20function collectStructureStats(): MemoryStructureStats {
21 return {
22 modificationHistory: getModificationHistoryStats(),
23 activitySubscribers: getActivitySubscriberCount(),
24 inspectorSubscribers: getInspectorSubscriberCount(),
25 consoleBufferLen: consoleBuffer.length,
26 networkBufferLen: networkBuffer.length,
27 dialogBufferLen: dialogBuffer.length,
28 captureBufferBytes: getCaptureBuffer().byteSize,
29 };
30}
31
32/**
33 * Pretty-print the snapshot for terminal output. JSON mode (--json) goes

Callers 2

handleMemoryCommandFunction · 0.85
buildMemorySnapshotJsonFunction · 0.85

Calls 3

getCaptureBufferFunction · 0.90

Tested by

no test coverage detected