diff --git a/src/rust/lqosd/src/node_manager/ws/ticker.rs b/src/rust/lqosd/src/node_manager/ws/ticker.rs index 4e84c1b1..9dacdf48 100644 --- a/src/rust/lqosd/src/node_manager/ws/ticker.rs +++ b/src/rust/lqosd/src/node_manager/ws/ticker.rs @@ -12,32 +12,35 @@ mod queue_stats_total; mod network_tree; use std::sync::Arc; +use std::time::Duration; +use tokio::time::timeout; use crate::node_manager::ws::publish_subscribe::PubSub; /// Runs a periodic tick to feed data to the node manager. pub(super) async fn channel_ticker(channels: Arc) { let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(1)); + interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); loop { interval.tick().await; // Once per second - tokio::join!( - cadence::cadence(channels.clone()), - throughput::throughput(channels.clone()), - rtt_histogram::rtt_histo(channels.clone()), - flow_counter::flow_count(channels.clone()), - top_10::top_10_downloaders(channels.clone()), - top_10::worst_10_downloaders(channels.clone()), - top_10::worst_10_retransmit(channels.clone()), - top_flows::top_flows_bytes(channels.clone()), - top_flows::top_flows_rate(channels.clone()), - flow_endpoints::endpoints_by_country(channels.clone()), - flow_endpoints::ether_protocols(channels.clone()), - flow_endpoints::ip_protocols(channels.clone()), - system_info::cpu_info(channels.clone()), - system_info::ram_info(channels.clone()), - tree_summary::tree_summary(channels.clone()), - queue_stats_total::queue_stats_totals(channels.clone()), - network_tree::network_tree(channels.clone()), + let _ = tokio::join!( + timeout(Duration::from_secs_f32(0.9), cadence::cadence(channels.clone())), + timeout(Duration::from_secs_f32(0.9), throughput::throughput(channels.clone())), + timeout(Duration::from_secs_f32(0.9), rtt_histogram::rtt_histo(channels.clone())), + timeout(Duration::from_secs_f32(0.9), flow_counter::flow_count(channels.clone())), + timeout(Duration::from_secs_f32(0.9), top_10::top_10_downloaders(channels.clone())), + timeout(Duration::from_secs_f32(0.9), top_10::worst_10_downloaders(channels.clone())), + timeout(Duration::from_secs_f32(0.9), top_10::worst_10_retransmit(channels.clone())), + timeout(Duration::from_secs_f32(0.9), top_flows::top_flows_bytes(channels.clone())), + timeout(Duration::from_secs_f32(0.9), top_flows::top_flows_rate(channels.clone())), + timeout(Duration::from_secs_f32(0.9), flow_endpoints::endpoints_by_country(channels.clone())), + timeout(Duration::from_secs_f32(0.9), flow_endpoints::ether_protocols(channels.clone())), + timeout(Duration::from_secs_f32(0.9), flow_endpoints::ip_protocols(channels.clone())), + timeout(Duration::from_secs_f32(0.9), system_info::cpu_info(channels.clone())), + timeout(Duration::from_secs_f32(0.9), system_info::ram_info(channels.clone())), + timeout(Duration::from_secs_f32(0.9), tree_summary::tree_summary(channels.clone())), + timeout(Duration::from_secs_f32(0.9), queue_stats_total::queue_stats_totals(channels.clone())), + timeout(Duration::from_secs_f32(0.9), network_tree::network_tree(channels.clone())), ); } } \ No newline at end of file