Nils Andreas Svee
7e0f434251
refactor: replace legacy Config with Settings
...
Remove legacy src/config.rs and migrate all application consumers to
the nested Settings model. Baseliner, metrics, pingers, ratecontroller,
reflector selector, and main now use Settings. Derived min rates become
methods on NetworkSettings rather than stored legacy fields.
MeasurementType and ObservabilityProtocol move into the settings module.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee
c1bcb22b23
refactor(baseliner): Replace shared Mutex state with thread-safe control snapshots
...
Eliminate lock contention between the baseliner, ratecontroller, and selector by moving to a message-passing architecture using immutable snapshots of reflector state. This improves data consistency and simplifies cross-thread communication.
2026-07-24 00:05:41 +07:00
Nils Andreas Svee
50f0dcb4dd
perf(baseliner): bound the reselection channel to prevent memory buildup
...
Change the reselection channel from unbounded to a size of 1 and use non-blocking sends to avoid unnecessary queuing of reselection triggers.
2026-07-17 11:39:07 +07:00
Nils Andreas Svee
9811592f13
feat(platform): introduce abstractions for cross-platform interface statistics and traffic control
...
Decouple the rate controller from Linux-specific Netlink calls to support other operating systems. This adds a macOS backend for interface statistics and an "observe-only" mode for platforms where traffic shaping is not yet implemented.
2026-07-17 11:35:43 +07:00
Nils Andreas Svee
8b0c37bc83
refactor: simplify control flow and error handling in metrics and netlink
2026-07-05 12:44:44 +07:00
Nils Andreas Svee
4aaf8fa100
chore: add SPDX license identifiers and copyright headers to source files
...
Apply the MPL-2.0 license to all source files and include the full license text to ensure legal compliance and proper attribution.
2026-04-23 12:39:52 +07:00
Nils Andreas Svee
3322e82b6c
refactor: replace std::sync::mpsc with flume for improved channel performance
...
Migrate internal message passing to flume to leverage better performance and additional features like eventual fairness and selection.
2026-04-22 22:39:06 +07:00
Nils Andreas Svee
ea19c6d68b
style: remove unused synchronization imports
...
Eliminate unused Arc, Mutex, and RwLock imports to clean up codebase and reduce compiler warnings.
2026-04-22 22:26:44 +07:00
Nils Andreas Svee
a81d208c0d
style: refine logging verbosity and improve diagnostic messages
...
Demote baseline telemetry to debug level, add context to rate controller warnings, and remove redundant string conversions in reflector selection logs.
2026-04-22 22:09:26 +07:00
Nils Andreas Svee
d0e3394f03
refactor: add ArcMutex/ArcRwLock type aliases
...
Replace repeated Arc> and Arc> with concise type aliases for readability.
2026-04-18 19:04:35 +02:00
Nils Andreas Svee
bda1a44b6e
feat(threads): Add graceful shutdown checks to worker loops
2026-04-14 02:03:53 +07:00
Nils Andreas Svee
f8976a78a2
feat(metrics): support arbitrary event tags and enhance monitoring coverage
...
Enable key-value metadata for events to track dry-run status and introduce new monitoring events for rate controller failure states.
2026-04-14 01:45:07 +07:00
Nils Andreas Svee
3095e32d41
refactor(ratecontroller): migrate to MetricsSender for metric dispatch
2026-04-13 18:57:50 +07:00
Nils Andreas Svee
d1ea0d0238
feat(observability): export rate and load metrics from rate controller
...
Send rates, load statistics, and delay deltas via the metrics channel to enable real-time monitoring of network performance.
2026-04-13 15:22:24 +07:00
Nils Andreas Svee
da3487e506
feat(observability): make metrics collection optional and granular
...
Wrap metrics senders in Option and conditionally initialize the monitoring thread to support granular configuration and reduced overhead.
2026-04-13 15:22:15 +07:00
Nils Andreas Svee
671e3f2671
refactor: standardize channel naming with tx and rx suffixes
...
Rename internal channel senders and receivers to follow standard Rust conventions for improved code consistency and readability.
2026-04-13 15:07:00 +07:00
Nils Andreas Svee
e5ba021a96
feat(observability): Pass metrics sender to rate controller and reflector selector
2026-04-13 15:01:46 +07:00
Nils Andreas Svee
f0fb3c9640
feat(monitoring): add dry-run mode to simulate qdisc rate changes
...
Enable a monitoring-only mode that logs intended bandwidth adjustments without applying them to the system via netlink.
2026-04-13 12:11:05 +07:00
Nils Andreas Svee
a4a83222fe
refactor(ratectrl): Enhance stability and file handling
2026-02-22 17:05:01 +07:00
Nils Andreas Svee
c116dd3e74
refactor(sync): Replace unwrap with anyhow-based locking
2026-02-22 16:57:11 +07:00
Nils Andreas Svee
d4ad24ce4a
feat(util): Introduce Mutex/RwLock error handling traits
2026-02-22 16:57:02 +07:00
Nils Andreas Svee
8589a1c7dc
feat(ratecontrol): Fallback to min rates
2026-02-22 12:13:14 +07:00
Nils Andreas Svee
5af42c4a22
refactor(ratecontrol): Rate calculation uses floor
2026-02-22 12:13:14 +07:00
Nils Andreas Svee
f2113fa11c
refactor(ratecontrol): Use custom Time for logging
2026-02-22 12:13:13 +07:00
Nils Andreas Svee
830e21363a
refactor: replace rand crate with fastrand
...
Replaces the `rand` crate with `fastrand` for improved performance in rate control and reflector selection.
2026-02-22 00:33:57 +07:00
Nils Andreas Svee
986b649a37
feat(netlink): Refactors to use netlink-socket2
...
Migrates netlink implementation to use netlink-socket2 and netlink-bindings crates, replacing neli crate for improved socket handling. Removes unused dependencies.
2026-02-21 23:10:48 +07:00
Nils Andreas Svee
2aec477b89
refactor(ratecontroller): Simplify delta_stat logic
2026-02-21 22:42:20 +07:00
Nils Andreas Svee
056288b0e8
fix(ratecontroller): correct generation of initial speeds
2026-02-21 22:20:30 +07:00
Nils Andreas Svee
a427d4078b
chore(deps): Update rand and log imports
2026-02-21 00:22:57 +07:00
Nils Andreas Svee
3b9f00cd75
fix: account for rand crate changes
2025-05-08 23:48:38 +07:00
Nils Andreas Svee
786639bf56
Move creation of State struct to a function
2022-11-25 20:19:06 +01:00
Nils Andreas Svee
6659e72ab4
add missing newline to stats dumping
2022-11-21 18:15:25 +01:00
Nils Andreas Svee
5c0a6c304f
ratecontroller: use durations instead of manually handling time
2022-11-10 13:54:26 +01:00
Nils Andreas Svee
d5823634ca
Handle initialization for first ratecontroller run better
2022-10-29 22:34:52 +02:00
Nils Andreas Svee
13ba3eaffe
Rename 'clock' to 'time'
2022-10-29 22:30:19 +02:00
Nils Andreas Svee
befccc0d6f
move util functions into respective modules
2022-10-19 21:23:52 +02:00
Nils Andreas Svee
1c38d8ff48
ratecontroller: no need to manually construct duration
2022-10-18 16:22:15 +02:00
Nils Andreas Svee
d2e0d2b0be
Remove ratecontroller debug print
2022-10-15 15:05:07 +02:00
Nils Andreas Svee
cacc5b1a6b
Apply Clippy recommendations
2022-10-15 14:58:05 +02:00
Nils Andreas Svee
c1286b0ba9
Add clock wrapper class
2022-10-15 13:44:30 +02:00
Nils Andreas Svee
1adc5fda77
Split out the ratecontroller logic into functions
...
The original Lua code was duplicated per direction, making it more difficult to read and more prone to mistakes when changing things.
Start splitting this logic out into functions that are called per direction
2022-10-13 17:18:54 +02:00
Nils Andreas Svee
214ffef6f3
Use proper error handling instead of lurking panics everywhere
2022-10-04 16:20:24 +02:00
Nils Andreas Svee
cf14fcd5f8
Some cleanups
2022-09-28 01:41:51 +02:00
Nils Andreas Svee
d73693c25f
Set interface "directions" based on names
2022-09-28 00:50:20 +02:00
Nils Andreas Svee
9219ac690a
Use a RwLock instead of a Mutex for the peers
2022-09-28 00:43:48 +02:00
Nils Andreas Svee
e3b7b7e9ba
Implement missing features, some cleanup
2022-09-28 00:25:35 +02:00
Nils Andreas Svee
c06078fccb
fix ratecontroller vec access
2022-09-17 18:06:02 +02:00
Nils Andreas Svee
b147006a69
partly working implementation
2022-09-17 14:39:27 +02:00