diff --git a/src/rust/lqos_node_manager/static/circuit_queue.html b/src/rust/lqos_node_manager/static/circuit_queue.html index 12aeb853..399b9a3c 100644 --- a/src/rust/lqos_node_manager/static/circuit_queue.html +++ b/src/rust/lqos_node_manager/static/circuit_queue.html @@ -194,6 +194,7 @@
Flows (Last 30 Seconds)
+
@@ -245,10 +246,13 @@ }); if (params.id != null) { // Name the circuit - $.get("/api/circuit_info/" + encodeURI(params.id), (data) => { - circuit_info = data; - $("#circuitName").text(redactText(circuit_info.name)); - }); + if (circuit_info == null) { + $.get("/api/circuit_info/" + encodeURI(params.id), (data) => { + circuit_info = data; + let capacity = scaleNumber(circuit_info.capacity[0]) + " / " + scaleNumber(circuit_info.capacity[1]); + $("#circuitName").text(redactText(circuit_info.name) + " " + capacity); + }); + } // Fill the raw button $("#raw").html(" Raw Data"); @@ -385,8 +389,6 @@ Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); }); } - - setTimeout(pollQueue, 1000); } let ips = []; @@ -478,8 +480,6 @@ Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true, title: '# Samples' }, xaxis: {automargin: true, title: '% Utilization'} }); }); } - - setTimeout(getThroughput, 1000); } let funnels = new MultiRingBuffer(300); @@ -536,7 +536,6 @@ rtts[data[i][0]].plot("rtt" + data[i][0]); } }); - setTimeout(plotFunnels, 1000); } function ecn(n) { @@ -567,6 +566,8 @@ } } + var madeButtons = false; + function getFlows() { let ip_list = ""; let ip_btns = ""; @@ -575,10 +576,15 @@ ip_btns += "Packet Dump: " + ips[i] + "" } ip_btns += "
"; + if (!madeButtons) { + madeButtons = true; + $("#packetButtons").html(ip_btns); + } ip_list = ip_list.substring(0, ip_list.length-1); + if (ip_list == "") return; $.get("/api/flows/" + ip_list, (data) => { //console.log(data); - let html = ip_btns + ""; + let html = "
"; html += ""; html += ""; html += ""; @@ -636,7 +642,16 @@ html += "
ProtocolSrc
"; $("#flowList").html(html); }) - setTimeout(getFlows, 1000); + } + + let id = 0; + + function oneSecondCadence() { + pollQueue(); + getThroughput(); + getFunnel(id); + getFlows(); + setTimeout(oneSecondCadence, 1000); } function start() { @@ -645,7 +660,9 @@ const params = new Proxy(new URLSearchParams(window.location.search), { get: (searchParams, prop) => searchParams.get(prop), }); + id = params.id; $.get("/api/watch_circuit/" + params.id, () => { + oneSecondCadence(); pollQueue(); getThroughput(); getFunnel(params.id); diff --git a/src/rust/lqos_queue_tracker/src/tracking/mod.rs b/src/rust/lqos_queue_tracker/src/tracking/mod.rs index fa2ae3f3..a59d63cf 100644 --- a/src/rust/lqos_queue_tracker/src/tracking/mod.rs +++ b/src/rust/lqos_queue_tracker/src/tracking/mod.rs @@ -18,7 +18,7 @@ fn track_queues() { } let config = LibreQoSConfig::load(); if config.is_err() { - warn!("Unable to read LibreQoS config. Skipping queue collection cycle."); + //warn!("Unable to read LibreQoS config. Skipping queue collection cycle."); return; } let config = config.unwrap(); @@ -49,7 +49,7 @@ fn track_queues() { if let Ok(download) = download { if let Ok(upload) = upload { if let Some(mut circuit) = CIRCUIT_TO_QUEUE.get_mut(circuit_id) { - if !download.is_empty() && upload.is_empty() { + if !download.is_empty() && !upload.is_empty() { circuit.update(&download[0], &upload[0]); } } else { diff --git a/src/rust/lqos_queue_tracker/src/tracking/watched_queues.rs b/src/rust/lqos_queue_tracker/src/tracking/watched_queues.rs index 9904e74a..3c6d49aa 100644 --- a/src/rust/lqos_queue_tracker/src/tracking/watched_queues.rs +++ b/src/rust/lqos_queue_tracker/src/tracking/watched_queues.rs @@ -60,7 +60,7 @@ pub fn add_watched_queue(circuit_id: &str) { }; WATCHED_QUEUES.insert(circuit.circuit_id.as_ref().unwrap().clone(), new_watch); - //info!("Added {circuit_id} to watched queues. Now watching {} queues.", WATCHED_QUEUES.read().len()); + //info!("Added {circuit_id} to watched queues. Now watching {} queues.", WATCHED_QUEUES.len()); } else { warn!("No circuit ID of {circuit_id}"); }