Skip to content

docs: refresh README architecture diagram to cover dynamic profiling#117

Merged
mlim19 merged 8 commits into
masterfrom
docs/architecture-diagram-dynamic-profiling
Jun 9, 2026
Merged

docs: refresh README architecture diagram to cover dynamic profiling#117
mlim19 merged 8 commits into
masterfrom
docs/architecture-diagram-dynamic-profiling

Conversation

@prashantbytesyntax

Copy link
Copy Markdown
Contributor

Summary

The legacy system_overview.png only depicts the one-way continuous data plane (agent → backend → S3 → indexer → ClickHouse) and predates the dynamic profiling work that has since landed (heartbeat protocol, ProfilingRequests / ProfilingCommands / ProfilingExecutions, two-slot agent, PerfSpect HW metrics — see heartbeat_doc/).

This PR replaces the README's System Overview section with a Mermaid diagram that captures both the continuous data plane and the new dynamic profiling control plane, and expands the component list with the new endpoints. The legacy PNG is left in the repo and called out as legacy rather than deleted.

What the new diagram shows

  • Agent (host) — single node summarising continuous + ad-hoc profiling and the optional Intel® PerfSpect HW-metrics path. Implementation detail (heartbeat loop, CommandManager priority queue, ContinuousProfilerSlot, AdhocProfilerSlot) is documented in prose immediately below the diagram and in heartbeat_doc/README_HEARTBEAT.md.
  • Frontend UI — Flame graph / search views and the Dynamic Profiling Console (Start / Stop, target hosts / PIDs, PerfSpect HW metrics checkbox).
  • Backendwebapp/backend (FastAPI) including the new control-plane endpoints (/api/metrics/heartbeat, /api/metrics/profile_request[/bulk], /api/metrics/command_completion, /api/metrics/profiling/host_status), agents-logs-backend, gprofiler_indexer, gprofiler_flamedb_rest.
  • Storage — Postgres (HostHeartbeats, ProfilingRequests, ProfilingCommands, ProfilingExecutions, service metadata), ClickHouse (flamedb), S3, SQS.
  • Two flows
    • Continuous data plane (solid arrows): Agent → backend → S3 → SQS → indexer → ClickHouse → flamedb_rest → backend → UI.
    • Dynamic profiling control plane (dashed arrows): bidirectional agent ⇄ backend heartbeat / command, with the UI creating profiling requests through the same backend.

Style

The Mermaid theme is tuned for a light-grey canvas with Figma-style pastel cards (per-tier colour: agent = blue, UI = amber, backend = violet, store = pink, AWS = orange) and dashed edges for the control plane. Drop the source into mermaid.live to export PNG / SVG for slides or blog posts.

Why not just regenerate the PNG

Mermaid renders natively on GitHub, lives next to the prose it describes, stays diff-able as the architecture evolves, and avoids drift between code and image-only docs. The legacy PNG remains available for historical reference.

Note

Supersedes the earlier fork-based PR #116, which has been closed.

Test plan

  • Verify the Mermaid diagram renders correctly on the GitHub PR / README preview.
  • Sanity-check that all referenced components / endpoints exist in the codebase (heartbeat_doc/README_HEARTBEAT.md, src/gprofiler/backend/routers/metrics_routes.py, src/gprofiler/frontend/src/components/console/ProfilingStatusPage.jsx, heartbeat_doc/PERFSPECT_DYNAMIC_PROFILING.md).
  • No source / build files were touched — docs-only change.

Made with Cursor

prashantbytesyntax and others added 8 commits June 4, 2026 20:43
The legacy `system_overview.png` only depicts the one-way continuous
data plane (agent -> backend -> S3 -> indexer -> ClickHouse) and
predates the dynamic profiling work. Replace the System Overview
section with a Mermaid diagram that captures both:

- Continuous profiling data plane (existing).
- Dynamic profiling control plane: heartbeat protocol, ProfilingRequests
  / ProfilingCommands / ProfilingExecutions, agent two-slot architecture
  (ContinuousProfilerSlot + AdhocProfilerSlot) with CommandManager
  priority queue, and optional Intel(R) PerfSpect HW metrics path.

Also expands the component list with the new control-plane endpoints
and links out to heartbeat_doc/ for full details. Marks the old PNG as
legacy rather than deleting it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…d control plane)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ph and rx/ry

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…e light-grey cards

Co-authored-by: Cursor <cursoragent@cursor.com>
@prashantbytesyntax prashantbytesyntax requested a review from mlim19 June 4, 2026 21:31

@mlim19 mlim19 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@mlim19 mlim19 merged commit 7765b65 into master Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants