Commit Graph
100 Commits
Author SHA1 Message Date
Nils Andreas Svee 40d68b64ab chore(deps): switch netlink dependencies from git to crates.io 2026-07-21 10:34:17 +07:00
Nils Andreas Svee 8236f0d7a5 feat(platform): add FreeBSD support for interface statistics
Implement interface statistics for FreeBSD using sysctl and introduce a basic UCI configuration source for Linux. Include a cross-compilation configuration and a target check script to verify multi-platform support.
2026-07-20 23:06:23 +07:00
Nils Andreas Svee cd6d631afa refactor(config): remove unimplemented measurement types
Remove NTP and TCP timestamp variants from the measurement type configuration since they are currently unimplemented and lead to runtime panics.
2026-07-20 23:06:23 +07:00
Nils Andreas Svee b07dc99bf5 fix(deps): update rust crate icmp-socket2 to 0.5.1 2026-07-17 13:07:30 +07:00
Nils Andreas Svee ae9193580c refactor(platform): restructure platform-specific abstractions and add synthetic backends 2026-07-17 13:02:17 +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 c5d673fcb8 build(uci): restrict UCI dependency and feature to Linux targets
Ensure the UCI integration is only compiled on Linux, as the underlying native dependency is platform-specific. Added a build script to warn users when the feature is enabled on unsupported platforms.
2026-07-17 01:43:10 +07:00
Nils Andreas Svee b56c8b72cc refactor(main): modularize main loop and improve resource cleanup logic 2026-07-14 22:53:01 +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 694cad1fac chore(deps): update wasm and web-related dependencies 2026-07-03 00:50:00 +07:00
Nils Andreas Svee 908fbfdf04 refactor(deps): cleanup netlink-bindings and shlex dependencies 2026-07-03 00:50:00 +07:00
Nils Andreas Svee 2dacde8a3f chore(deps): update cargo dependencies 2026-07-03 00:50:00 +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 dfa11be236 chore: add MPLv2.0 license
The original Lua sqm-autorate project is licensed under the MPLv2.0, and this project started life as a pure port of that. Thus our code should also be licensed under the MPL
2026-04-23 12:19:49 +07:00
Nils Andreas Svee 58d536bb22 refactor(pinger): replace hashlru with standard HashMap and manual TTL cleanup
Remove the hashlru dependency to reduce bloat, replacing it with a Mutex-wrapped HashMap and manual entry expiration logic.
2026-04-23 00:33:07 +07:00
Nils Andreas Svee 6f16f3a93c build(deps): disable default features for hashlru to reduce dependency bloat
Remove unused dependencies including ahash, hashbrown, and zerocopy by disabling default features for hashlru.
2026-04-23 00:19:00 +07:00
Nils Andreas Svee 1b959d52ed feat(main): Initialize and pass InFlightProbeCache to pinger threads 2026-04-23 00:16:19 +07:00
Nils Andreas Svee 8c29d7b251 feat(pinger): Integrate in-flight probe cache into sender and listener 2026-04-23 00:16:19 +07:00
Nils Andreas Svee 80adb368d4 feat(pinger): Implement new craft_packet signature for ICMP types 2026-04-23 00:16:19 +07:00
Nils Andreas Svee 6ae19b619a feat(pinger): Introduce InFlightProbeCache and update Ping traits 2026-04-23 00:16:19 +07:00
Nils Andreas Svee 7250050f63 feat(deps): Add hashlru for in-flight probe caching 2026-04-23 00:16:19 +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 e22c100e57 refactor(main): Relocate and enhance signal handler with improved logging 2026-04-22 21:45:27 +07:00
Nils Andreas Svee 72fe0230ee style: Apply general code formatting and import reordering 2026-04-22 21:45:25 +07:00
Nils Andreas Svee 6690402a34 chore(deps): update dependencies and switch rust-uci to git revision
Update bindgen, nom, and other core dependencies while switching rust-uci and libuci-sys to a specific git revision to ensure compatibility with recent project changes.
2026-04-22 16:55:46 +07:00
Nils Andreas Svee 3ec53a1224 refactor: Migrate configuration to new UCI path prefix and boolean helper 2026-04-22 16:55:05 +07:00
Nils Andreas Svee 7d5c2f0275 refactor: Add boolean configuration helper and streamline host tag retrieval 2026-04-22 16:55:05 +07:00
Nils Andreas Svee 45da0c030e feat: Add flexible boolean parsing for configuration 2026-04-22 16:55:05 +07:00
Nils Andreas Svee 33169182be chore(deps): update rust-uci repository source
Switch the rust-uci dependency to the namib-project fork while maintaining the same revision to ensure availability and consistency with project requirements.
2026-04-22 15:11:16 +07:00
Nils Andreas Svee 2aea1bea86 chore(deps): switch rust-uci to git dependency
Update rust-uci to use a specific git revision from the upstream repository to incorporate latest changes not yet available in the published version.
2026-04-22 15:06:45 +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 7c40990e93 chore(deps): switch netlink dependencies to upstream git and remove vendor patch
Replace the local vendored patch for netlink-socket2 with a direct reference to the upstream git repository to maintain the fix for musl targets.

This should be changed back to using a release once the fix has a published release
2026-04-18 15:41:02 +07:00
Nils Andreas Svee 11837195de chore(deps): update rust dependencies
Update several crates including cc, cmake, fastrand, and quote to their latest versions to maintain up-to-date build tools and libraries.
2026-04-14 16:04:02 +07:00
Nils Andreas Svee 7b0eb942ea fix(deps): patch netlink-socket2 to support musl targets
Vendor netlink-socket2 to resolve compilation failures caused by direct struct-literal initialization of libc types on musl.
2026-04-14 15:00:49 +07:00
Nils Andreas Svee 5daccecc1d fix(deps): update rust crate netlink-bindings to 0.3
Adjust netlink and traffic control logic to accommodate breaking API changes, including shifts from method calls to direct field access.
2026-04-14 13:09:50 +07:00
Nils Andreas Svee 8739ed4419 fix(metrics): use AtomicU32 for drop counter to support MIPS targets
Also bumps version to 0.4.1.
2026-04-14 02:14:55 +07:00
Nils Andreas Svee 99e80c381d build: bump package version to 0.4.0 2026-04-14 02:09:20 +07:00
Nils Andreas Svee 3c689b1d1e feat(main): Orchestrate application shutdown and cleanup 2026-04-14 02:03:53 +07: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 6e4e6b85e9 feat(shutdown): Implement global shutdown signal handling 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 60e7ffc9e7 refactor(main): integrate MetricsSender across application entry point 2026-04-13 18:57:51 +07:00
Nils Andreas Svee 2db63e6159 refactor(reflector_selector): migrate to MetricsSender for event dispatch 2026-04-13 18:57:50 +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 57382465bf refactor(pinger): migrate to MetricsSender for metric dispatch 2026-04-13 18:57:50 +07:00
Nils Andreas Svee e9e233d98a refactor(baseliner): migrate to MetricsSender for metric dispatch 2026-04-13 18:57:50 +07:00
Nils Andreas Svee 8036d27e6f feat(metrics): track and report dropped metric counts 2026-04-13 18:57:50 +07:00
Nils Andreas Svee 451d42640b refactor(metrics): encapsulate metric dispatch with MetricsSender 2026-04-13 18:57:50 +07:00
Nils Andreas Svee b930a01fd6 feat(observability): emit a startup event metric to signal application initialization
Send a telemetry event when the process starts to provide better visibility into application lifecycle transitions.
2026-04-13 17:49:19 +07:00
Nils Andreas Svee e7cbdbb265 docs(observability): document rationale for unbatched UDP metric flushing
Explain that individual metric delivery prevents data truncation caused by small UDP receive buffers on the remote host.
2026-04-13 17:36:30 +07:00
Nils Andreas Svee 1d7fd5800b refactor(observability): initialize metrics collection earlier in the startup sequence
Move the metrics thread and error channel initialization before the settling period and peer setup to ensure early telemetry is captured.
2026-04-13 17:34:17 +07:00
Nils Andreas Svee 699c8782d9 fix(observability): send individual metrics over UDP to avoid packet size limits
Differentiate flushing logic between transport types to prevent UDP payload truncation while maintaining batched delivery for TCP.
2026-04-13 17:21:14 +07:00
Nils Andreas Svee 0f902e27a3 perf(observability): optimize metric flushing to reduce memory allocations
Use a pre-allocated buffer for metric serialization to improve efficiency when processing large batches.
2026-04-13 16:54:33 +07:00
Nils Andreas Svee 530a715bdf fix(observability): refresh metric timestamps on each loop iteration
Move clock initialization inside processing loops to ensure exported metrics reflect the current time rather than a stale timestamp.
2026-04-13 16:32:30 +07:00
Nils Andreas Svee dd8735f46e chore(deps): update icmp-socket2 to 0.4.2
Update the icmp-socket2 dependency version in Cargo.toml and Cargo.lock to incorporate the latest upstream changes.
2026-04-13 16:23:20 +07:00
Nils Andreas Svee 72b4bc8dab fix(observability): ensure all metric outputs are newline-terminated
Append trailing newlines to metric string formats to ensure consistent parsing and record separation by monitoring backends.
2026-04-13 15:43:09 +07:00
Nils Andreas Svee 757a715a54 chore: cleanup unused imports 2026-04-13 15:29:04 +07:00
Nils Andreas Svee 5af5b6597b feat(observability): report reflector selection events and outcomes
Emit metrics detailing why a reflector reselection was triggered and which peers were selected to improve selection process visibility.
2026-04-13 15:28:56 +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 2c1e7c0483 feat(observability): Export baseline statistics and events 2026-04-13 15:01:46 +07:00
Nils Andreas Svee 645ac08daa feat(observability): Export ping related metrics 2026-04-13 15:01:46 +07:00
Nils Andreas Svee 1452409fe8 feat(observability): Integrate metrics exporter into main application flow 2026-04-13 15:01:46 +07:00
Nils Andreas Svee 44f551d38c feat(observability): Add InfluxDB Line Protocol metrics module and config 2026-04-13 15:01:45 +07:00
Nils Andreas Svee 853f807e2c feat: add metrics module for monitoring
Initialize the Metrics structure to receive and process ping statistics as part of the monitoring subsystem.
2026-04-13 12:11:05 +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 6d44556d63 style: reformat thread builder calls in main.rs
Standardize the formatting of thread spawning for the receiver and sender to improve code consistency and readability.
2026-04-13 12:06:50 +07:00
Nils Andreas Svee 8461d29788 build: bump version to 0.3.0
Update package version in Cargo.toml and Cargo.lock to reflect a new release.
2026-04-01 12:55:52 +07:00
Nils Andreas Svee 9c51853147 refactor: update imports to use icmp-socket2 2026-04-01 12:52:19 +07:00
Nils Andreas Svee 050291990a build: migrate from icmp-socket to icmp-socket2 2026-04-01 12:52:19 +07:00
Nils Andreas Svee cac3d75ccb build: update dependencies and remove redundant windows targets 2026-04-01 12:52:18 +07:00
Nils Andreas Svee c2a7c5dfdb refactor(main): Optimize reflector list assignment 2026-02-22 17:05:06 +07:00
Nils Andreas Svee a4a83222fe refactor(ratectrl): Enhance stability and file handling 2026-02-22 17:05:01 +07:00
Nils Andreas Svee c45351042e fix(pinger): Improve robustness of pinger operations 2026-02-22 17:04:56 +07:00
Nils Andreas Svee 1a87372ffb refactor(main): Centralize thread error handling 2026-02-22 16:58: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 fa370b323b feat(pinger): Configurable tick interval 2026-02-22 12:13:14 +07:00
Nils Andreas Svee 489e3f45f7 feat(config): Dynamic min rate calculation 2026-02-22 12:13:14 +07:00
Nils Andreas Svee 1357a23578 fix(reflector): Remove no-op 'len()' call 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 0990332f18 refactor(log): Use custom Time for timestamps 2026-02-22 12:13:13 +07:00
Nils Andreas Svee eb88107bd0 chore(deps): Remove 'time' crate 2026-02-22 12:13:13 +07:00
Nils Andreas Svee 714a121113 feat(time): Add granular time getters 2026-02-22 12:13:01 +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 616a3b1c70 fix(netlink): Improves error handling
Refactors error handling for interface and queue discipline operations to provide more informative error messages. This aids in debugging and user experience.
2026-02-21 23:21:32 +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 e2962222b7 fix: Improve error handling for reflector list loading
Improves error handling when the reflector list file is not found, providing more context about the failure.
2026-02-21 23:06:32 +07:00
Nils Andreas Svee 99a7928a66 style(reflector): Reorder imports and truncate vector 2026-02-21 22:42:20 +07:00
Nils Andreas Svee 127ed692c3 refactor(reflector): Improve candidate selection loop 2026-02-21 22:42:20 +07:00
Nils Andreas Svee 2aec477b89 refactor(ratecontroller): Simplify delta_stat logic 2026-02-21 22:42:20 +07:00
Nils Andreas Svee 67bb185e28 refactor(main): Make reflector pool configurable 2026-02-21 22:42:20 +07:00
Nils Andreas Svee 66a2834192 feat(reflector): Use configurable reselection time 2026-02-21 22:42:20 +07:00