Add anonymous usage options to lqos.conf and the example file.

This commit is contained in:
Herbert Wolverson 2023-03-16 20:12:18 +00:00
parent beead5a303
commit 5805d9860e
2 changed files with 17 additions and 0 deletions

View File

@ -5,6 +5,10 @@
lqos_directory = '/opt/libreqos/src'
queue_check_period_ms = 1000
[usage_stats]
send_anonymous = true
anonymous_server = "127.0.0.1:9125"
[tuning]
# IRQ balance breaks XDP_Redirect, which we use. Recommended to leave as true.
stop_irq_balance = true

View File

@ -21,6 +21,9 @@ pub struct EtcLqos {
/// If present, defines the values for various `sysctl` and `ethtool`
/// tweaks.
pub tuning: Option<Tunables>,
/// If present, defined anonymous usage stat sending
pub usage_stats: Option<UsageStats>,
}
/// Represents a set of `sysctl` and `ethtool` tweaks that may be
@ -104,6 +107,16 @@ pub struct BridgeVlan {
pub redirect_to: u32,
}
/// Definitions for anonymous usage submission
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct UsageStats {
/// Are we allowed to send stats at all?
pub send_anonymous: bool,
/// Where do we send them?
pub anonymous_server: String,
}
impl EtcLqos {
/// Loads `/etc/lqos.conf`.
pub fn load() -> Result<Self, EtcLqosError> {