1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 08:57:46 +00:00
Commit graph

44 commits

Author SHA1 Message Date
diniamo
5a197951d9 treewide: finish renaming to Watt 2025-06-06 15:15:00 +02:00
NotAShelf
32422f2b4f
treewide: streamline error handling; leverage thiserror and anyhow 2025-05-18 15:45:19 +03:00
NotAShelf
99fbfc0ea7
daemon: use internal error types 2025-05-18 14:26:42 +03:00
NotAShelf
38960ce8bc
daemon: don't store unused fields 2025-05-18 14:18:18 +03:00
NotAShelf
747362b88b
daemon: replace debug_assert with an actual error 2025-05-18 13:38:33 +03:00
NotAShelf
58273d89f4
daemon: get rid of config hot-reloading 2025-05-18 13:27:18 +03:00
NotAShelf
ee5bd8f80f
daemon: handle invalid config values gracefully 2025-05-18 12:20:19 +03:00
NotAShelf
63cab6e631
daemon: clean up weighted average calculation 2025-05-18 08:36:51 +03:00
NotAShelf
2efc0e1a6b
daemon: use u128 arithmetic to prevent overflow in polling interval calc
Overflows are unlikely to happen, but easy to prevent. Let's fix it while we're at it.
2025-05-18 08:27:53 +03:00
NotAShelf
34862b28e1
daemon: enforce >= 1s minimum interval in clamping 2025-05-18 08:11:46 +03:00
NotAShelf
8c462868b6
daemon: use abs_diff to remove lossy casts 2025-05-18 07:52:32 +03:00
NotAShelf
ad70a85426
daemon: use integer arithmetic to avoid precision loss 2025-05-18 07:43:01 +03:00
NotAShelf
984793d445
daemon: historical interval blending 2025-05-18 07:28:07 +03:00
NotAShelf
e83941d64b treewide: unify error handling with special error type across modules 2025-05-17 08:00:09 +03:00
NotAShelf
862e090bc6
daemon: fix typo in comment 2025-05-17 06:23:07 +03:00
NotAShelf
c046c27376
daemon: prioritize load checks over idle state in system state determination 2025-05-17 06:20:26 +03:00
NotAShelf
f0932c64d9
daemon: prevent busy loops via minimum polling interval 2025-05-17 06:01:00 +03:00
NotAShelf
ff4e6e69c8
daemon: deduplicate idle state check logic 2025-05-17 05:47:39 +03:00
NotAShelf
139746069a
daemon: cross-platform safe arithmetic 2025-05-17 05:39:01 +03:00
NotAShelf
59602b0e3e
daemon: refactor SystemHistory init; derive Default for SystemState 2025-05-17 05:19:32 +03:00
NotAShelf
4aea53e060
daemon: refactor idle time multiplier calculation for adaptive polling 2025-05-17 04:59:39 +03:00
NotAShelf
ff2f305d9e
daemon: optimize CPU usage averaging in SystemHistory updates 2025-05-17 04:40:30 +03:00
NotAShelf
70a59cec82
daemon: cleaner idle time handling and progressive back-off adjustments 2025-05-17 04:31:05 +03:00
NotAShelf
035d7b8848
daemon: avoid potential u64 overflow when scaling long poll intervals 2025-05-17 04:02:09 +03:00
NotAShelf
eea1f52c26
daemon: progressive logarithmic back-off for idle periods
1min -> 1.5x, 2min -> 2x, 4min -> 3x, etc.

Addresses poll interval inflation issues caused by noise in battery
measurements and hopefully improve power efficiency during extended
idle periods.
2025-05-17 03:22:30 +03:00
NotAShelf
6335f139f9
daemon: improve polling interval adjustment
Casting float ->→ u64 risks silent truncation & sub-second intervals. We now *round*
the computed interval, and ensure a minimum value of 1 to avoid zero or overly-small
polling intervals.
2025-05-17 03:02:51 +03:00
NotAShelf
4fcfeb073d
daemon: clamp battery discharge rate to a maximum of 100%/hour 2025-05-17 03:01:29 +03:00
NotAShelf
f71534f7ef
daemon: refactor polling interval calculation; use a struct 2025-05-17 02:45:57 +03:00
NotAShelf
7431c22825
daemon: refactor polling interval calculation into a separate function 2025-05-17 02:26:51 +03:00
NotAShelf
8d784b5d56
daemon: reset battery discharge tracking on AC connection; preserve history 2025-05-17 02:12:54 +03:00
NotAShelf
7047f64984
daemon: enforce user-configured min and max polling interval limits 2025-05-17 02:08:21 +03:00
NotAShelf
264cd6a4e9
daemon change CPU and temperature history to use VecDeque 2025-05-17 01:52:35 +03:00
NotAShelf
8c3a1848e1
daemon: more sophisticated adaptive polling
There are gains to be had.
2025-05-17 01:44:24 +03:00
atagen
59af990b4c core: remove conflicts.rs 2025-05-16 12:50:19 +10:00
raf
f4fceed893
Merge branch 'main' into better-battery-mgnmnt 2025-05-16 01:57:23 +03:00
NotAShelf
09a38dd136
core: battery limit management 2025-05-15 17:05:14 +03:00
Bloxx12
1645c921d7
config: follow XDG base spec
moves /etc/superfreq/config.toml to /etc/xdg/superfreq/config.toml
to follow xdg base spec more closely.
2025-05-14 11:38:05 +02:00
NotAShelf
b7f374c32c
core: switch to log for proper logging 2025-05-14 02:57:37 +03:00
NotAShelf
fad56e6e1e
core: improve formatting & display for info command 2025-05-14 02:05:12 +03:00
NotAShelf
498d179aa8
config: improve watcher; debounce 2025-05-14 01:39:47 +03:00
NotAShelf
9f7d86ff01
config: modularize; add config watcher and move error variants 2025-05-14 01:17:42 +03:00
NotAShelf
72ebbf3761
daemon: add conflict detection and governor override
Also adds governor override functionality allowing users to persistently force
a specific CPU governor mode.
2025-05-13 23:55:27 +03:00
NotAShelf
4bf4ab5673
daemon: less verbosity by default; fine-tune via config 2025-05-13 22:49:16 +03:00
NotAShelf
48bf7508aa
core: init daemon mode for persistent operations 2025-05-13 22:28:16 +03:00