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
raf
39736f2925
Merge pull request #22 from NotAShelf/complete-config-watcher
...
config: streamline hotreload; don't search in `$XDG_CONFIG_HOME`
2025-05-16 21:11:06 +03:00
NotAShelf
ed1aeddaed
config: streamline hotreload; don't search in $XDG_CONFIG_HOME
2025-05-16 21:06:56 +03:00
atagen
59af990b4c
core: remove conflicts.rs
2025-05-16 12:50:19 +10:00
NotAShelf
d0cc9e4fb3
cpu: reduce allocations for EPP values
2025-05-16 05:10:01 +03:00
NotAShelf
5b347eb3e2
cpu: scan all CPUs for available governors; cleanup
2025-05-16 05:00:41 +03:00
NotAShelf
3d4d3b8075
battery: refactor sysfs handler into util module
2025-05-16 04:42:21 +03:00
NotAShelf
a3137ff2d0
battery: bettery error handling in sysfs value reading
2025-05-16 04:03:08 +03:00
NotAShelf
6c2fc6652f
monitor: optimize path search for CPU frequency directory
2025-05-16 03:46:54 +03:00
NotAShelf
e6b7f3eb34
battery: case-insensitive matching for peripherals
2025-05-16 03:32:41 +03:00
NotAShelf
4e03679209
cli: use Clap's value parser for cheaper validation
2025-05-16 03:18:50 +03:00
NotAShelf
8f860424f9
battery: better validation for battery charge thresholds
...
To accommodate vendors that use 0 to mean "charge immediately" or "disable start threshold," we
modified the validation logic to allow start to be 0 *as long as* start is less than stop and
stop is less than OR equal to 100
2025-05-16 03:11:05 +03:00
NotAShelf
622f4f6f32
engine: simplify error handling
2025-05-16 03:06:59 +03:00
NotAShelf
c1d81b687c
battery: deduplicate frequency validation logic
2025-05-16 03:03:35 +03:00
NotAShelf
7d28d12c1c
cpu: update governor override path
2025-05-16 02:20:43 +03:00
NotAShelf
df5ae64c44
cpu: add alternative EPP string formats for better compat
2025-05-16 02:20:09 +03:00
NotAShelf
3d490db734
battery: better threshold setting logic
2025-05-16 02:19:15 +03:00
NotAShelf
cd68ffd054
battery: remove writable path checker
2025-05-16 02:13:44 +03:00
NotAShelf
2a5c00e3a7
battery: skip writable check for power supply path
...
It wouldn't even work, lol.
2025-05-16 02:04:00 +03:00
raf
f4fceed893
Merge branch 'main' into better-battery-mgnmnt
2025-05-16 01:57:23 +03:00
NotAShelf
d3f2442ccc
config: add valid EPB strings; better validation
2025-05-16 01:52:16 +03:00
NotAShelf
e8d7d1ab86
cpu: prevent possible overflow in frequency calculations
2025-05-16 01:42:08 +03:00
NotAShelf
18141d22e1
config: improve EPP value validation
2025-05-16 01:33:38 +03:00
NotAShelf
2256cf25f9
cpu: better governor validation
2025-05-16 01:27:43 +03:00
NotAShelf
09427ccc9a
config: better serialization in config structs
2025-05-16 01:05:37 +03:00
NotAShelf
8252f0d74e
config: better validation of battery charge threshold; update error handling
2025-05-16 00:42:51 +03:00
NotAShelf
eb97689bc7
battery: simplify file permission check and improve threshold inheritance
2025-05-16 00:18:46 +03:00
NotAShelf
d8f609fdef
{core,battery}: better input validation; path, permission and sanity checks
...
- battery: add path existence and writability check for threshold support
- cpu: validate governor and EPP values, and add frequency validation
- engine: validate turbo auto settings for proper configuration
- main: add validation for minimum and maximum frequency inputs
2025-05-16 00:02:09 +03:00
NotAShelf
6fe322272e
core: validate tresholds at the CLI level
2025-05-15 23:20:08 +03:00
NotAShelf
90fd077a67
config: make ProfileConfig
serialisable
2025-05-15 22:58:47 +03:00
NotAShelf
b11bad74d5
battery: perform permission checks upfront
2025-05-15 22:54:02 +03:00
NotAShelf
705fc6c46d
battery: use a reference to SupportedBattery
instead of clones
2025-05-15 22:20:02 +03:00