cm-dashboard/BENCHMARK.md
Christoffer Martinsson 8a36472a3d Implement real-time process monitoring and fix UI hardcoded data
This commit addresses several key issues identified during development:

Major Changes:
- Replace hardcoded top CPU/RAM process display with real system data
- Add intelligent process monitoring to CpuCollector using ps command
- Fix disk metrics permission issues in systemd collector
- Optimize service collection to focus on status, memory, and disk only
- Update dashboard widgets to display live process information

Process Monitoring Implementation:
- Added collect_top_cpu_process() and collect_top_ram_process() methods
- Implemented ps-based monitoring with accurate CPU percentages
- Added filtering to prevent self-monitoring artifacts (ps commands)
- Enhanced error handling and validation for process data
- Dashboard now shows realistic values like "claude (PID 2974) 11.0%"

Service Collection Optimization:
- Removed CPU monitoring from systemd collector for efficiency
- Enhanced service directory permission error logging
- Simplified services widget to show essential metrics only
- Fixed service-to-directory mapping accuracy

UI and Dashboard Improvements:
- Reorganized dashboard layout with btop-inspired multi-panel design
- Updated system panel to include real top CPU/RAM process display
- Enhanced widget formatting and data presentation
- Removed placeholder/hardcoded data throughout the interface

Technical Details:
- Updated agent/src/collectors/cpu.rs with process monitoring
- Modified dashboard/src/ui/mod.rs for real-time process display
- Enhanced systemd collector error handling and disk metrics
- Updated CLAUDE.md documentation with implementation details
2025-10-16 23:55:05 +02:00

58 lines
1.4 KiB
Markdown

# CM Dashboard Agent Performance Benchmark
## Test Environment
- Host: srv01
- Rust: release build with optimizations
- Test date: 2025-10-16
- Collection interval: 5 seconds (realtime for all collectors)
## Benchmark Methodology
1. Set all collectors to realtime (5s interval)
2. Test each collector individually
3. Measure CPU usage with `ps aux` after 10 seconds
4. Record collection time from debug logs
## Baseline - All Collectors Enabled
### Results
- **CPU Usage**: 74.6%
- **Total Metrics**: ~80 (5 CPU + 6 Memory + 3 Disk + ~66 Systemd)
- **Collection Time**: ~1350ms (dominated by systemd collector)
## Individual Collector Tests
### CPU Collector Only
- **CPU Usage**: TBD%
- **Metrics Count**: TBD
- **Collection Time**: TBD ms
- **Utilities Used**: `/proc/loadavg`, `/sys/class/thermal/thermal_zone*/temp`, `/proc/cpuinfo`
### Memory Collector Only
- **CPU Usage**: TBD%
- **Metrics Count**: TBD
- **Collection Time**: TBD ms
- **Utilities Used**: `/proc/meminfo`
### Disk Collector Only
- **CPU Usage**: TBD%
- **Metrics Count**: TBD
- **Collection Time**: TBD ms
- **Utilities Used**: `du -s /tmp`
### Systemd Collector Only
- **CPU Usage**: TBD%
- **Metrics Count**: TBD
- **Collection Time**: TBD ms
- **Utilities Used**: `systemctl list-units`, `systemctl show <service>`, `du -s <service-dir>`
## Analysis
### Performance Bottlenecks
- TBD
### Recommendations
- TBD
### Optimal Cache Intervals
Based on performance impact:
- TBD