How gooda/perf_monitor works
iOS Perf Monitor is a React dashboard that connects to an iOS performance backend, consumes live WebSocket metrics and stack traces, stores them as monitoring state, and presents overview, per-process, and stack-analysis views. The graph separates connection/ingestion, metric state, dashboard modes, and presentation. The README documents the backend contract and the three modes; source excerpts and the SOURCE INDEX support the shown internal links, but do not establish every chart’s precise data path.
Main entry points: App.tsx App shell · OverviewPanel.tsx System overview · ProcessPanel.tsx Process analysis · perfStore.ts Performance store
Components 18
Dashboard
- App shell
src/App.tsx
Connection & Ingestion
- Connection controls
src/components/panels/ConnectionPanel.tsx - WebSocket hook
src/hooks/useWebSocket.ts - WebSocket service
src/services/websocket.ts
Monitoring State
- Performance store
src/stores/perfStore.ts - Theme store
src/stores/themeStore.ts
Analysis Views
- System overview
src/components/panels/OverviewPanel.tsx - Process analysis
src/components/panels/ProcessPanel.tsx - Stack analysis
src/components/panels/DetailedPanel.tsx
Charts & Theme
- Metric cards
src/components/ui/MetricCard.tsx - Line chart
src/components/charts/LineChart.tsx - Multi-line chart
src/components/charts/MultiLineChart.tsx - Stacked area chart
src/components/charts/StackedAreaChart.tsx - Bidirectional chart
src/components/charts/BidirectionalChart.tsx - Flame graph
src/components/charts/FlameGraph.tsx - Theme toggle
src/components/ui/ThemeToggle.tsx
Other components
- Dashboard user
- ios_perf backend
Connections 22
- Dashboard user → App shell: uses
- App shell → Connection controls: renders
src/App.tsx - App shell → System overview: selects view
src/App.tsx - App shell → Process analysis: selects view
src/App.tsx - App shell → Stack analysis: selects view
src/App.tsx - App shell → Theme toggle: renders
src/App.tsx - Connection controls → WebSocket hook: controls
src/components/panels/ConnectionPanel.tsx - WebSocket hook → WebSocket service: calls
src/hooks/useWebSocket.ts - WebSocket service → ios_perf backend: exchanges metrics
README.md - WebSocket hook → Performance store: updates
src/hooks/useWebSocket.ts - System overview → Performance store: reads metrics
src/components/panels/OverviewPanel.tsx - Process analysis → Performance store: reads process data
src/components/panels/ProcessPanel.tsx - Stack analysis → Performance store: reads stack data
src/components/panels/DetailedPanel.tsx - System overview → Metric cards: renders
- System overview → Line chart: renders
- System overview → Multi-line chart: renders
- Process analysis → Metric cards: renders
src/components/panels/ProcessPanel.tsx - Process analysis → Stacked area chart: renders
src/components/panels/ProcessPanel.tsx - Process analysis → Bidirectional chart: renders
src/components/panels/ProcessPanel.tsx - Stack analysis → Flame graph: renders
- Theme toggle → Theme store: updates
src/components/ui/ThemeToggle.tsx - App shell → Theme store: initializes
src/main.tsx