How wanchenrui/windows-performance-monitor works
PerfMonitor is a Windows-local system and process performance monitor. Its main workflow is scheduled sampling, native-backed metric collection, bounded in-memory snapshot/history storage, contract-v1 adaptation, then loopback HTTP delivery to a browser dashboard. The README also documents capabilities and health endpoints plus a deprecated compatibility endpoint. Evidence is strongest for the sampled Python wiring; schema and .NET DTO roles come from the README and tree, so uncertain implementation links are omitted.
Main entry points: server.py Loopback HTTP API · app.py App lifecycle · sampling.py Fixed sampler · collector.py System metrics
Components 15
Runtime lifecycle
- App lifecycle
app.py - Fixed sampler
perf_monitor/sampling.py
Metric collection
- System metrics
perf_monitor/collector.py - Process counters
perf_monitor/windows_process.py - Error mapping
perf_monitor/errors.py
Snapshot and contract
- RAM snapshot history
perf_monitor/store.py - Contract adapter
perf_monitor/contract_v1.py - Contract schemas
contracts/v1 - Client DTOs
src/PerfMonitor.Contracts/Contracts.cs
Local interfaces
- Loopback HTTP API
perf_monitor/server.py - Browser dashboard
static/dashboard.js - Dashboard assets
static/index.html - Health and capabilities
perf_monitor/contract_v1.py - Legacy stats adapter
perf_monitor/server.py
Other components
- Local user
Connections 19
- Local user → App lifecycle: starts
README.md - App lifecycle → Fixed sampler: starts
app.py - Fixed sampler → System metrics: collects
perf_monitor/sampling.py - System metrics → Process counters: queries
perf_monitor/collector.py - System metrics → Error mapping: maps failures
perf_monitor/collector.py - Fixed sampler → Error mapping: maps failures
perf_monitor/sampling.py - Fixed sampler → RAM snapshot history: publishes snapshot
perf_monitor/sampling.py - App lifecycle → RAM snapshot history: creates
app.py - App lifecycle → Loopback HTTP API: starts
app.py - Loopback HTTP API → RAM snapshot history: reads
perf_monitor/server.py - Loopback HTTP API → Contract adapter: builds responses
perf_monitor/server.py - Contract adapter → Error mapping: uses codes
perf_monitor/contract_v1.py - Contract adapter → Contract schemas: implements contract
README.md - Client DTOs → Contract schemas: matches contract
README.md - Browser dashboard → Loopback HTTP API: requests data
README.md - Local user → Browser dashboard: views
README.md - Dashboard assets → Browser dashboard: hosts
README.md - Loopback HTTP API → Health and capabilities: serves
perf_monitor/server.py - Loopback HTTP API → Legacy stats adapter: serves
perf_monitor/server.py