From 0f1ff6eac03b33fd6b69c6452870776ac09bb6a2 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Thu, 16 Jan 2025 14:11:56 -0600 Subject: [PATCH] Explicitly refuse to gather any stats if gather_stats is false or the license key is empty. --- .../lqosd/src/throughput_tracker/stats_submission.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rust/lqosd/src/throughput_tracker/stats_submission.rs b/src/rust/lqosd/src/throughput_tracker/stats_submission.rs index e89237e3..061b9b51 100644 --- a/src/rust/lqosd/src/throughput_tracker/stats_submission.rs +++ b/src/rust/lqosd/src/throughput_tracker/stats_submission.rs @@ -53,6 +53,18 @@ pub(crate) fn submit_throughput_stats( counter: u8, system_usage_actor: crossbeam_channel::Sender>, ) { + let config = load_config(); + if config.is_err() { + return; + } + let config = config.unwrap(); + if config.long_term_stats.gather_stats == false { + return; + } + if config.long_term_stats.license_key.is_none() { + return; + } + let mut metrics = LtsSubmitMetrics::new(); let mut lts2_needs_shaped_devices = false; // If ShapedDevices has changed, notify the stats thread