[Part 5/6] feat(telemetry): add activity monitor with event-driven snapshots#8124
Conversation
|
It would be great to get this in! Please merge to reflect the changes already landed for memory monitor and then we can take a look. |
47a4ec0 to
ecd4673
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
Thank you for this contribution. The new ActivityMonitor is a great addition for event-driven telemetry. I've found a couple of high-severity issues that should be addressed to improve the robustness and maintainability of the new module. My main concerns are around the lifecycle management of listeners and a function name collision that could cause confusion. Please see my detailed comments below.
Hi @jacob314, ready for review! |
b22a59b to
792981a
Compare
|
The test file-system-interactive.test.ts introduced in #11046 was failing due to a race condition. The test wasn't awaiting @jacob314 take a look for re-approval, so we can continue in #8125 , thanks |
9d74e9b to
dc1433a
Compare
dc1433a to
de2e7f6
Compare
|
@jacob314 fixed conflict on rebase & format fix, ready for merge |
…apshots (google-gemini#8124) Co-authored-by: Jacob Richman <jacob314@gmail.com>

Summary
Introduces ActivityMonitor to track user events and trigger throttled memory snapshots when performance monitoring is active. This component bridges user activity detection with memory monitoring for intelligent telemetry collection.
Dependencies
✅ All dependencies merged to main:
Branch Status: Rebased on latest main (all dependencies included).
Related PRs - Enhanced Performance Monitoring Split
This is Part 5 of 6 in the split implementation of #2127:
Changes in This PR
🆕 Files Added:
packages/core/src/telemetry/activity-monitor.ts- ActivityMonitor implementationpackages/core/src/telemetry/activity-monitor.test.ts- Comprehensive unit testspackages/core/src/telemetry/index.ts- ActivityMonitor exportsActivityMonitor (
packages/core/src/telemetry/activity-monitor.ts)Event-Driven Memory Snapshots:
isPerformanceMonitoringActive()returns trueKey Features:
getMemoryMonitor()from Part 4 for actual memory collectionisUserActive()from Part 2 for smart timingDefault Configuration:
API Interface:
Testing
✅ ActivityMonitor unit tests:
activity-monitor.test.ts- Event triggering, memory snapshot integration, throttling behaviorTechnical Architecture
Component Integration Stack:
Rebase Status
✅ Successfully rebased on main (commit: 603ec2b)
✅ All preflight checks passing
Next Steps: Part 6 will add CLI hooks to wire ActivityMonitor into the actual user interface event flows.