How mccannex/sysmon works
SysMon is an ESP-IDF component that samples FreeRTOS task and memory statistics, then serves telemetry and an embedded browser dashboard. The main workflow is application initialization after network connectivity, background sampling and history collection, HTTP endpoint responses, and browser-side visualization. The README documents dashboard capabilities beyond the sampled C excerpts; those are represented at subsystem level. Source excerpts establish runtime and API wiring, but browser-script interactions are not shown, so their internal edges are omitted.
Main entry points: app.js Dashboard updates · sysmon_http.c HTTP server and routes · sysmon.c SysMon lifecycle · sysmon_handlers.c Request handlers
Components 21
Runtime lifecycle
- SysMon lifecycle
src/sysmon.c - Connectivity checks
src/sysmon_utils.c
Monitoring and state
- Task and resource sampler
src/sysmon.c - Task usage history
src/sysmon.c - CPU and memory history
src/sysmon.c - Stack registration
src/sysmon_stack.c
HTTP and telemetry
- HTTP server and routes
src/sysmon_http.c - Request handlers
src/sysmon_handlers.c - Telemetry JSON
src/sysmon_json.c - Route configuration
include/sysmon_config.h - HTTP utilities
src/sysmon_utils.c
Browser dashboard
- Dashboard updates
www/js/app.js - Charts
www/js/charts.js - Task tables
www/js/table.js - Dashboard configuration
www/js/config.js - Dashboard utilities
www/js/utils.js - Theme controls
www/js/theme.js - Embedded web assets
www
Other components
- ESP-IDF application
- Connected network
- Web browser
Connections 23
- ESP-IDF application → SysMon lifecycle: initializes
README.md - SysMon lifecycle → Connectivity checks: checks connectivity
src/sysmon.c - Connected network → Connectivity checks: provides connection
README.md - SysMon lifecycle → HTTP server and routes: starts server
src/sysmon.c - SysMon lifecycle → Task and resource sampler: starts task
src/sysmon.c - Task and resource sampler → Task usage history: records samples
src/sysmon.c - Task and resource sampler → CPU and memory history: records samples
src/sysmon.c - ESP-IDF application → Stack registration: registers stacks
README.md - Task and resource sampler → Stack registration: uses registrations
- HTTP server and routes → Route configuration: configures routes
src/sysmon_http.c - HTTP server and routes → Request handlers: registers handlers
src/sysmon_http.c - Request handlers → Telemetry JSON: calls configured builder
src/sysmon_handlers.c - Request handlers → HTTP utilities: uses content type
src/sysmon_handlers.c - Telemetry JSON → Task usage history: reads task history
src/sysmon_json.c - Telemetry JSON → CPU and memory history: reads system history
src/sysmon_json.c - Web browser → Embedded web assets: loads dashboard
README.md - Embedded web assets → HTTP server and routes: served by
src/sysmon_http.c - Web browser → HTTP server and routes: requests telemetry
README.md - Dashboard updates → Charts
- Dashboard updates → Task tables
- Dashboard updates → Dashboard configuration
- Dashboard updates → Dashboard utilities
- Dashboard updates → Theme controls