From 89521b03d6fe6298e8d6bea59958a86e9decd848 Mon Sep 17 00:00:00 2001 From: yetone Date: Sat, 17 Oct 2026 20:40:21 +0800 Subject: [PATCH] cli, gateway: magpie cpu records the running magpie's CPU profile for 30s, for a report of high CPU (@LeiCheng42 on X) @LeiCheng42 on X reports magpie using the most CPU while Codex runs. As with magpie heap (e085d6e92), Activity Monitor and `sample` show Go's frames as ???, so `magpie cpu [] [--seconds N]` asks the magpie serving the gateway for GET /v1/magpie/cpu?seconds=N: runtime/pprof's CPU profile over 30s (5..120; else 400), gzipped protobuf, with the pid, version, uptime, CPU time used over the window (getrusage / GetProcessTimes) and since start, cores, GOMAXPROCS and goroutines in X-Magpie-CPU-Stats. It tells the user to use magpie as when busy (run Codex) while it records, writes else magpie-cpu--