Commit 7fb40b8
committed
Add heartbeat-based dynamic profiling system
This PR introduces a heartbeat protocol that enables dynamic profiling
control. Agents periodically send heartbeats to a Performance Studio
backend and receive start/stop profiling commands, allowing on-demand
profiling without agent restarts.
Key features:
- HeartbeatClient for server communication
- DynamicGProfilerManager for profiler lifecycle management
- Command idempotency to prevent duplicate execution
- Support for dynamic profiler configuration
- PerfSpect hardware metrics integration
- Comprehensive test suite with mock and live modes
- Complete documentation with examples
Files added:
- gprofiler/heartbeat.py (627 lines)
- docs/HEARTBEAT_SYSTEM_README.md (634 lines)
- tests/test_heartbeat_system.py (358 lines)
- tests/run_heartbeat_agent.py (136 lines)
Files modified:
- gprofiler/main.py (heartbeat initialization)
Source: Pinterest's gprofiler repository
Testing: Mock tests pass, live tests verified with backend1 parent 37e6acc commit 7fb40b8
5 files changed
Lines changed: 1838 additions & 30 deletions
File tree
- docs
- gprofiler
- tests
0 commit comments