MCPcopy
hub / github.com/deepnote/deepnote / captureMemoryBeforeBlock

Function captureMemoryBeforeBlock

packages/cli/src/commands/run.ts:1158–1171  ·  view source on GitHub ↗
(
  state: RunExecutionState,
  engine: ExecutionEngine,
  blockId: string
)

Source from the content-addressed store, hash-verified

1156}
1157
1158async function captureMemoryBeforeBlock(
1159 state: RunExecutionState,
1160 engine: ExecutionEngine,
1161 blockId: string
1162): Promise<void> {
1163 if (!state.showProfile || !engine.serverPort) {
1164 return
1165 }
1166
1167 const metrics = await fetchMetrics(engine.serverPort)
1168 if (metrics) {
1169 state.memoryBefore.set(blockId, metrics.rss)
1170 }
1171}
1172
1173async function recordBlockProfile(
1174 state: RunExecutionState,

Callers 1

Calls 1

fetchMetricsFunction · 0.90

Tested by

no test coverage detected