| src | Reduce temperature sampling frequency | |
| .gitignore | Initial commit | |
| Cargo.lock | Initial commit | |
| Cargo.toml | Initial commit | |
| README.md | Reduce temperature sampling frequency | |
temp-chart
A Linux terminal application that samples package-level CPU temperatures every 2,000 ms and plots both a 96-hour history and a six-hour detail view of:
- temperature readings in orange;
- rolling mean + 2 sigma and rolling mean - 2 sigma boundaries in cyan and blue.
The mean and population standard deviation use each sensor's trailing two-minute window, including the current reading.
The UI uses Ratatui. Samples are appended to a JSON Lines file and flushed after every batch. Restart downtime therefore appears as a gap instead of erasing history. The file is compacted to the 96-hour retention window at startup and every six hours.
Older data files without a persisted rolling mean remain supported; their means are reconstructed from the retained temperature history when loaded.
Chart data is incrementally aggregated into fixed-time min/max buckets. Normal redraws therefore process a bounded number of points based on terminal width, rather than rescanning the full 96-hour sample history. A full aggregation pass is only needed on initial display or after the terminal width changes.
Run
cargo run --release
By default, data is stored in ./cpu-temperature-history.jsonl. To put it
elsewhere:
cargo run --release -- --data-file ~/.local/share/temp-chart/history.jsonl
List the Linux sysfs sensors the program selected:
cargo run --release -- --list-sensors
Press q, Esc, or Ctrl-C to quit.
Sensor selection
The collector reads Linux hwmon CPU drivers such as coretemp, k10temp,
zenpower, and peci_cputemp. When package-level labels such as Package id 0, Tctl, or Tdie exist, core-level channels are omitted to keep the chart
readable. If no supported hwmon device is found, CPU-related thermal zones are
used as a fallback.
The process needs read access to the relevant files below /sys/class/hwmon or
/sys/class/thermal.