mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-06 22:54:36 +00:00
fix(desktop): bind CPU exports to their capture sources
This commit is contained in:
parent
b4a6c8da3b
commit
6221beaa38
1 changed files with 2 additions and 3 deletions
|
|
@ -56,11 +56,10 @@ export function createProfiling(contents: WebContents, cdp: Cdp, files: BrowserF
|
|||
),
|
||||
)
|
||||
if (cpu.result) return cpu.result
|
||||
const resources = cpu.resources
|
||||
clearTimeout(cpu.timer)
|
||||
cpu.result = cdp.send("Profiler.stop").then(async ({ profile }) => ({
|
||||
id: await files.save("profile.cpuprofile", "application/json", Buffer.from(JSON.stringify(profile)), [
|
||||
...(cpu?.resources ?? []),
|
||||
]),
|
||||
id: await files.save("profile.cpuprofile", "application/json", Buffer.from(JSON.stringify(profile)), [...resources]),
|
||||
durationMs: (profile.endTime - profile.startTime) / 1000,
|
||||
}))
|
||||
return cpu.result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue