# rbonghi/jetson_stats architecture

> Architecture diagram of the GitHub repository rbonghi/jetson_stats, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rbonghi/jetson_stats
- Repository: https://github.com/rbonghi/jetson_stats

## Overview

jetson-stats monitors and controls NVIDIA Jetson boards. Users launch the terminal interface or use the Python client; the client communicates with a background service that gathers board telemetry and exposes control operations. The service relies on hardware-specific readers and command utilities, while the terminal UI presents the collected data. The README also documents hardware/software decoding and controls for fan speed, NVP model, and jetson_clocks. Some subsystem links reflect README capabilities or indexed imports; unsampled implementation details are not asserted.

Main entry points: [`jtop/service.py`](https://github.com/rbonghi/jetson_stats/blob/master/jtop/service.py) (Stats service), [`jtop/jtop.py`](https://github.com/rbonghi/jetson_stats/blob/master/jtop/jtop.py) (Python client), [`jtop/core/command.py`](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/command.py) (Command runner), [`jtop/gui/jtopgui.py`](https://github.com/rbonghi/jetson_stats/blob/master/jtop/gui/jtopgui.py) (Terminal UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["CLI entry<br/>[__main__.py]"]
  node_tui["Terminal UI<br/>[jtopgui.py]"]
  node_gui_pages["Monitoring pages<br/>[pall.py]"]
end

subgraph group_service["Service and client"]
  node_client["Python client<br/>[jtop.py]"]
  node_daemon["Stats service<br/>[service.py]"]
end

subgraph group_monitor["Monitoring"]
  node_hardware["Board identity<br/>[hardware.py]"]
  node_cpu["CPU metrics<br/>[cpu.py]"]
  node_gpu["GPU metrics<br/>[gpu.py]"]
  node_memory["Memory metrics<br/>[memory.py]"]
  node_engines["Engine metrics<br/>[engine.py]"]
  node_thermals["Thermal metrics<br/>[temperature.py]"]
  node_power["Power metrics<br/>[power.py]"]
end

subgraph group_control["Board controls"]
  node_fan["Fan control<br/>[fan.py]"]
  node_nvpmodel["NVP model<br/>[nvpmodel.py]"]
  node_clocks["Jetson clocks<br/>[jetson_clocks.py]"]
end

subgraph group_internal["Hardware support"]
  node_decode["Platform decode"]
  node_commands["Command runner<br/>[command.py]"]
end

node_user(("Jetson user"))

node_user -->|"launches"| node_cli
node_cli -->|"starts"| node_tui
node_user -->|"imports"| node_client
node_client -->|"requests data"| node_daemon
node_daemon -->|"publishes stats"| node_client
node_daemon -->|"loads identity"| node_hardware
node_daemon -->|"collects"| node_cpu
node_daemon -->|"collects"| node_gpu
node_daemon -->|"collects"| node_memory
node_daemon -->|"collects"| node_engines
node_daemon -->|"collects"| node_thermals
node_daemon -->|"collects"| node_power
node_daemon -->|"controls"| node_fan
node_daemon -->|"controls"| node_nvpmodel
node_daemon -->|"controls"| node_clocks
node_hardware -->|"decodes platform"| node_decode
node_fan -->|"runs commands"| node_commands
node_gpu -->|"runs commands"| node_commands
node_nvpmodel -->|"runs commands"| node_commands
node_clocks -->|"runs commands"| node_commands
node_tui -.->|"displays pages"| node_gui_pages
node_tui -->|"renders stats"| node_client

click node_cli "https://github.com/rbonghi/jetson_stats/blob/master/jtop/__main__.py"
click node_tui "https://github.com/rbonghi/jetson_stats/blob/master/jtop/gui/jtopgui.py"
click node_client "https://github.com/rbonghi/jetson_stats/blob/master/jtop/jtop.py"
click node_daemon "https://github.com/rbonghi/jetson_stats/blob/master/jtop/service.py"
click node_hardware "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/hardware.py"
click node_cpu "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/cpu.py"
click node_gpu "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/gpu.py"
click node_memory "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/memory.py"
click node_engines "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/engine.py"
click node_thermals "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/temperature.py"
click node_power "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/power.py"
click node_fan "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/fan.py"
click node_nvpmodel "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/nvpmodel.py"
click node_clocks "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/jetson_clocks.py"
click node_decode "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/jetson_variables.py"
click node_commands "https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/command.py"
click node_gui_pages "https://github.com/rbonghi/jetson_stats/blob/master/jtop/gui/pall.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_tui,node_gui_pages,node_user toneBlue
class node_client,node_daemon toneAmber
class node_hardware,node_cpu,node_gpu,node_memory,node_engines,node_thermals,node_power toneMint
class node_fan,node_nvpmodel,node_clocks toneRose
class node_decode,node_commands toneIndigo
```

## Components

### User interfaces

- [CLI entry](https://github.com/rbonghi/jetson_stats/blob/master/jtop/__main__.py): `jtop/__main__.py`
- [Terminal UI](https://github.com/rbonghi/jetson_stats/blob/master/jtop/gui/jtopgui.py): `jtop/gui/jtopgui.py`
- [Monitoring pages](https://github.com/rbonghi/jetson_stats/blob/master/jtop/gui/pall.py): `jtop/gui/pall.py`

### Service and client

- [Python client](https://github.com/rbonghi/jetson_stats/blob/master/jtop/jtop.py): `jtop/jtop.py`
- [Stats service](https://github.com/rbonghi/jetson_stats/blob/master/jtop/service.py): `jtop/service.py`

### Monitoring

- [Board identity](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/hardware.py): `jtop/core/hardware.py`
- [CPU metrics](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/cpu.py): `jtop/core/cpu.py`
- [GPU metrics](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/gpu.py): `jtop/core/gpu.py`
- [Memory metrics](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/memory.py): `jtop/core/memory.py`
- [Engine metrics](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/engine.py): `jtop/core/engine.py`
- [Thermal metrics](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/temperature.py): `jtop/core/temperature.py`
- [Power metrics](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/power.py): `jtop/core/power.py`

### Board controls

- [Fan control](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/fan.py): `jtop/core/fan.py`
- [NVP model](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/nvpmodel.py): `jtop/core/nvpmodel.py`
- [Jetson clocks](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/jetson_clocks.py): `jtop/core/jetson_clocks.py`

### Hardware support

- [Platform decode](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/jetson_variables.py): `jtop/core/jetson_variables.py`
- [Command runner](https://github.com/rbonghi/jetson_stats/blob/master/jtop/core/command.py): `jtop/core/command.py`

### Other components

- **Jetson user**

## Connections

- Jetson user → CLI entry: launches
- CLI entry → Terminal UI: starts (evidence: `jtop/__main__.py`)
- Jetson user → Python client: imports
- Python client → Stats service: requests data (evidence: `jtop/jtop.py`)
- Stats service → Python client: publishes stats (evidence: `jtop/service.py`)
- Stats service → Board identity: loads identity (evidence: `jtop/service.py`)
- Stats service → CPU metrics: collects (evidence: `jtop/service.py`)
- Stats service → GPU metrics: collects (evidence: `jtop/service.py`)
- Stats service → Memory metrics: collects (evidence: `jtop/service.py`)
- Stats service → Engine metrics: collects (evidence: `jtop/service.py`)
- Stats service → Thermal metrics: collects (evidence: `jtop/service.py`)
- Stats service → Power metrics: collects (evidence: `jtop/service.py`)
- Stats service → Fan control: controls (evidence: `jtop/service.py`)
- Stats service → NVP model: controls (evidence: `jtop/service.py`)
- Stats service → Jetson clocks: controls (evidence: `jtop/service.py`)
- Board identity → Platform decode: decodes platform (evidence: `jtop/core/hardware.py`)
- Fan control → Command runner: runs commands (evidence: `jtop/core/fan.py`)
- GPU metrics → Command runner: runs commands (evidence: `jtop/core/gpu.py`)
- NVP model → Command runner: runs commands (evidence: `jtop/core/nvpmodel.py`)
- Jetson clocks → Command runner: runs commands (evidence: `jtop/core/jetson_clocks.py`)
- Terminal UI → Monitoring pages: displays pages
- Terminal UI → Python client: renders stats (evidence: `jtop/gui/jtopgui.py`)
