mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Remove the majority of simple warnings for unused imports and/or variables.
This commit is contained in:
parent
149237e1b8
commit
362671d454
@ -4,7 +4,10 @@ use once_cell::sync::Lazy;
|
||||
use lqos_utils::units::{AtomicDownUp, DownUpOrder};
|
||||
use crate::tracking::TrackedQueue;
|
||||
|
||||
/// Holds all of the CAKE queue summaries being tracked by the system.
|
||||
pub static ALL_QUEUE_SUMMARY: Lazy<AllQueueData> = Lazy::new(|| AllQueueData::new());
|
||||
|
||||
/// Tracks the total number of drops and marks across all queues.
|
||||
pub static TOTAL_QUEUE_STATS: TotalQueueStats = TotalQueueStats::new();
|
||||
|
||||
pub struct TotalQueueStats {
|
||||
|
@ -82,7 +82,8 @@ fn track_queues() {
|
||||
expire_watched_queues();
|
||||
}
|
||||
|
||||
struct TrackedQueue {
|
||||
/// Holds the CAKE marks/drops for a given queue/circuit.
|
||||
pub struct TrackedQueue {
|
||||
circuit_id: String,
|
||||
drops: u64,
|
||||
marks: u64,
|
||||
|
@ -1,8 +1,6 @@
|
||||
use axum::extract::Path;
|
||||
use axum::Json;
|
||||
use lqos_bus::BusResponse;
|
||||
use lqos_config::NetworkJsonTransport;
|
||||
use crate::shaped_devices_tracker;
|
||||
use crate::shaped_devices_tracker::NETWORK_JSON;
|
||||
|
||||
pub async fn get_network_tree(
|
||||
|
@ -1,4 +1,3 @@
|
||||
use std::path::Path;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use axum::body::Body;
|
||||
use axum::http::header;
|
||||
|
@ -2,16 +2,11 @@ mod circuit;
|
||||
mod ping_monitor;
|
||||
mod flows_by_circuit;
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use axum::Extension;
|
||||
use axum::extract::WebSocketUpgrade;
|
||||
use axum::extract::ws::{Message, WebSocket};
|
||||
use axum::response::IntoResponse;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::spawn;
|
||||
use tokio::time::MissedTickBehavior;
|
||||
use crate::node_manager::ws::publish_subscribe::PubSub;
|
||||
use crate::node_manager::ws::single_user_channels::circuit::circuit_watcher;
|
||||
use crate::node_manager::ws::single_user_channels::flows_by_circuit::flows_by_circuit;
|
||||
use crate::node_manager::ws::single_user_channels::ping_monitor::ping_monitor;
|
||||
@ -25,16 +20,14 @@ enum PrivateChannel {
|
||||
|
||||
pub(super) async fn private_channel_ws_handler(
|
||||
ws: WebSocketUpgrade,
|
||||
Extension(channels): Extension<Arc<PubSub>>,
|
||||
) -> impl IntoResponse {
|
||||
log::info!("WS Upgrade Called");
|
||||
let channels = channels.clone();
|
||||
ws.on_upgrade(move |socket| async {
|
||||
handle_socket(socket, channels).await;
|
||||
handle_socket(socket).await;
|
||||
})
|
||||
}
|
||||
|
||||
async fn handle_socket(mut socket: WebSocket, channels: Arc<PubSub>) {
|
||||
async fn handle_socket(mut socket: WebSocket) {
|
||||
log::info!("Websocket connected");
|
||||
|
||||
let (tx, mut rx) = tokio::sync::mpsc::channel::<String>(10);
|
||||
|
@ -2,9 +2,7 @@ use std::net::IpAddr;
|
||||
use std::time::Duration;
|
||||
use serde::Serialize;
|
||||
use tokio::time::MissedTickBehavior;
|
||||
use lqos_sys::flowbee_data::FlowbeeKey;
|
||||
use lqos_utils::unix_time::time_since_boot;
|
||||
use lqos_utils::XdpIpAddress;
|
||||
use crate::shaped_devices_tracker::SHAPED_DEVICES;
|
||||
use crate::throughput_tracker::flow_data::{ALL_FLOWS, FlowAnalysis, FlowbeeLocalData, get_asn_name_and_country};
|
||||
|
||||
@ -27,11 +25,11 @@ fn recent_flows_by_circuit(circuit_id: &str) -> Vec<(FlowbeeKeyTransit, FlowbeeL
|
||||
}
|
||||
|
||||
// Don't show flows that don't belong to the circuit
|
||||
let mut local_ip_str = String::new();
|
||||
let mut remote_ip_str = String::new();
|
||||
let mut device_name = String::new();
|
||||
let mut asn_name = String::new();
|
||||
let mut asn_country = String::new();
|
||||
let local_ip_str ; // Using late binding
|
||||
let remote_ip_str ;
|
||||
let device_name ;
|
||||
let asn_name ;
|
||||
let asn_country ;
|
||||
let local_ip = match key.local_ip.as_ip() {
|
||||
IpAddr::V4(ip) => ip.to_ipv6_mapped(),
|
||||
IpAddr::V6(ip) => ip,
|
||||
|
@ -46,7 +46,6 @@ fn check_queues(interface: &str) -> Result<()> {
|
||||
#[derive(Debug)]
|
||||
pub struct IpLinkInterface {
|
||||
pub name: String,
|
||||
pub index: u32,
|
||||
pub operstate: String,
|
||||
pub link_type: String,
|
||||
pub master: Option<String>,
|
||||
@ -62,14 +61,12 @@ pub fn get_interfaces_from_ip_link() -> Result<Vec<IpLinkInterface>> {
|
||||
let mut interfaces = Vec::new();
|
||||
for interface in output_json.as_array().unwrap() {
|
||||
let name = interface["ifname"].as_str().unwrap().to_string();
|
||||
let index = interface["ifindex"].as_u64().unwrap() as u32;
|
||||
let operstate = interface["operstate"].as_str().unwrap().to_string();
|
||||
let link_type = interface["link_type"].as_str().unwrap().to_string();
|
||||
let master = interface["master"].as_str().map(|s| s.to_string());
|
||||
|
||||
interfaces.push(IpLinkInterface {
|
||||
name,
|
||||
index,
|
||||
operstate,
|
||||
link_type,
|
||||
master,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use std::{sync::atomic::AtomicU64, time::Duration};
|
||||
use crate::{shaped_devices_tracker::{NETWORK_JSON, SHAPED_DEVICES}, stats::HIGH_WATERMARK, throughput_tracker::flow_data::{expire_rtt_flows, flowbee_rtt_map}};
|
||||
use crate::{shaped_devices_tracker::SHAPED_DEVICES, stats::HIGH_WATERMARK, throughput_tracker::flow_data::{expire_rtt_flows, flowbee_rtt_map}};
|
||||
use super::{flow_data::{get_flowbee_event_count_and_reset, FlowAnalysis, FlowbeeLocalData, RttData, ALL_FLOWS}, throughput_entry::ThroughputEntry, RETIRE_AFTER_SECONDS};
|
||||
use dashmap::DashMap;
|
||||
use fxhash::FxHashMap;
|
||||
|
Loading…
Reference in New Issue
Block a user