MCPcopy
hub / github.com/CapSoftware/Cap / runAutomatedCycle

Function runAutomatedCycle

apps/desktop/scripts/desktop-memory-soak.js:387–413  ·  view source on GitHub ↗
(cycle, tracked, options)

Source from the content-addressed store, hash-verified

385}
386
387async function runAutomatedCycle(cycle, tracked, options) {
388 console.log(`Cycle ${cycle}/${options.cycles}: start recording`);
389 pressHotkey(HOTKEYS.startStudioRecording);
390 await sleep(options.recordingSeconds * 1000);
391
392 if (!options.skipDisplaySleep) {
393 console.log(
394 `Cycle ${cycle}/${options.cycles}: sleep display for ${options.displaySleepSeconds}s`,
395 );
396 sleepDisplay();
397 await sleep(options.displaySleepSeconds * 1000);
398 }
399
400 console.log(`Cycle ${cycle}/${options.cycles}: stop recording`);
401 pressHotkey(HOTKEYS.stopRecording);
402 await sleep(1000);
403 pressHotkey(HOTKEYS.stopRecording);
404 await sleep(3000);
405
406 return collectPhase(
407 `cycle-${cycle}`,
408 options.settleSeconds,
409 options.intervalSeconds,
410 tracked,
411 options,
412 );
413}
414
415async function main() {
416 if (process.platform !== "darwin") {

Callers 1

mainFunction · 0.85

Calls 4

pressHotkeyFunction · 0.85
sleepDisplayFunction · 0.85
collectPhaseFunction · 0.85
sleepFunction · 0.70

Tested by

no test coverage detected