一键导入
hgraf-profile-callback-perf
Profile ADK callback overhead on the current telemetry plugin + goldfive per-LLM-call metrics.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Profile ADK callback overhead on the current telemetry plugin + goldfive per-LLM-call metrics.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Understand and safely change heartbeat interval, stuck threshold, and timeout constants — client cadence, server detection math, frontend signal.
Add a new AnnotationKind — proto, storage, ingress RPC, optional downstream delivery to agents, frontend authoring UI, tests.
Add a new agent Capability — proto enum, client advertisement, server ingest, frontend gating in the control UI.
Add a new ControlKind — capability advertisement, client handler, server routing, ack semantics, frontend button, and tests — all the way through.
Add a new drift kind end-to-end. Goldfive owns the detector + enum; harmonograf reflects the kind through the intervention aggregator and the UI timeline.
Script a complex multi-turn FakeLlm scenario — function calls, tool chains, drift events, side-effect hooks, partial responses — for deterministic adk test coverage.
| name | hgraf-profile-callback-perf |
| description | Profile ADK callback overhead on the current telemetry plugin + goldfive per-LLM-call metrics. |
You changed something in the client's ADK plugin
(client/harmonograf_client/telemetry_plugin.py), in the ring buffer
or transport (buffer.py / transport.py), or in the server's
ingest pipeline, and you want to confirm you didn't regress per-call
latency.
With goldfive owning orchestration, the client's remaining hot paths are short:
| Hot path | Location | Dominant cost |
|---|---|---|
| ADK callback → span enqueue | telemetry_plugin.py | emit_span_* marshal + ring push |
| Ring buffer push | buffer.py | One deque append under threading.Lock |
| Transport drain | transport.py::_send_loop | pop_batch + proto marshal + gRPC queue put |
| Server ingest | server/ingest.py::handle_message | pb_span_to_storage + store.upsert_span + bus.publish_* |
| Sqlite write | storage/sqlite.py::append_span | aiosqlite INSERT under process-wide asyncio.Lock |
| Bus fan-out | bus.py::publish | One put_nowait per subscriber |
See dev-guide/performance-tuning.md for the full map.
goldfive.llm.duration_ms (goldfive#172) — wall-clock time of
each LLM call. Almost always the dominant cost in a "slow agent"
complaint.goldfive.llm.request.chars — request prompt size. Balloons
post-STEER when the steerer injects drift body + task state.buffered_events (from Heartbeat) — if this climbs, the
client can't drain fast enough. Usually the signal is network,
not local CPU.Log these via goldfive at INFO to see trends.
# Attach py-spy to a running agent:
py-spy top --pid $(pgrep -f my_agent)
py-spy dump --pid $(pgrep -f my_agent) | head -60
Hot frames to expect on a healthy agent:
google.adk.* (ADK machinery)goldfive.* (planner, steerer, detectors)litellm.* or the model provider's clientharmonograf_client.*Hot frames on harmonograf_client.telemetry_plugin or
harmonograf_client.transport that exceed single-digit percentage
of CPU point at a regression in the plugin or the transport.
hashlib.sha256 + chunking cost on every emit. Look for
hot frames in client.py::_attach_payload or
transport.py::_drain_payloads._stamp_agent_attrs path copies
the attrs dict on first sight of each agent. That cost is bounded
(once per (session_id, agent_id) pair) but if your change
invalidates the cache more aggressively, it multiplies.dev-guide/performance-tuning.md — the complete hot-path map.runbooks/high-latency-callbacks.md — operator-level diagnosis.