From 95ac0fa825f9e4350c1dda20a2723d58e33ba4d7 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Tue, 2 Jul 2024 13:00:02 -0500 Subject: [PATCH] Chugging along making UI adjustments. --- .../js_build/src/dashlets/throughput_bps_dash.js | 2 +- .../js_build/src/dashlets/throughput_pps_dash.js | 2 +- .../js_build/src/dashlets/throughput_ring_dash.js | 2 -- .../src/node_manager/js_build/src/graphs/bits_gauge.js | 10 +++++----- .../node_manager/js_build/src/graphs/packets_bar.js | 2 +- .../js_build/src/graphs/throughput_ring_graph.js | 8 ++++---- .../lqosd/src/node_manager/ws/ticker/throughput.rs | 5 +++-- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_bps_dash.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_bps_dash.js index c53085b6..d6d657fa 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_bps_dash.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_bps_dash.js @@ -23,7 +23,7 @@ export class ThroughputBpsDash extends BaseDashlet{ onMessage(msg) { if (msg.event === "Throughput") { - this.graph.update(msg.data.bps[0], msg.data.bps[1], msg.data.max[0], msg.data.max[1]); + this.graph.update(msg.data.bps.down, msg.data.bps.up, msg.data.max.down, msg.data.max.up); } } } \ No newline at end of file diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_pps_dash.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_pps_dash.js index 0123b89b..4e22deb1 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_pps_dash.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_pps_dash.js @@ -23,7 +23,7 @@ export class ThroughputPpsDash extends BaseDashlet{ onMessage(msg) { if (msg.event === "Throughput") { - this.graph.update(msg.data.pps[0], msg.data.pps[1]); + this.graph.update(msg.data.pps.down, msg.data.pps.up); } } } \ No newline at end of file diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_ring_dash.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_ring_dash.js index cad45780..c1ea63ca 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_ring_dash.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/throughput_ring_dash.js @@ -27,8 +27,6 @@ export class ThroughputRingDash extends BaseDashlet{ onMessage(msg) { if (msg.event === "Throughput") { - let shaped = msg.data.shaped_bps[0] + msg.data.shaped_bps[1]; - let unshaped = msg.data.bps[0] + msg.data.bps[1]; this.graph.update(msg.data.shaped_bps, msg.data.bps); } } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/graphs/bits_gauge.js b/src/rust/lqosd/src/node_manager/js_build/src/graphs/bits_gauge.js index 78e06a91..e30c49da 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/graphs/bits_gauge.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/graphs/bits_gauge.js @@ -132,14 +132,14 @@ export class BitsPerSecondGauge extends DashboardGraph { this.option && this.chart.setOption(this.option); } - update(value1, value2, max1, max2) { + update(download, upload, max_down, max_up) { this.chart.hideLoading(); - this.option.series[0].data[0].value = value1; - this.option.series[1].data[0].value = value2; + this.option.series[0].data[0].value = download; + this.option.series[1].data[0].value = upload; this.option.series[0].min = 0; - this.option.series[0].max = max1 * 1000000; // Convert to bits + this.option.series[0].max = max_down * 1000000; // Convert to bits this.option.series[1].min = 0; - this.option.series[1].max = max2 * 1000000; // Convert to bits + this.option.series[1].max = max_up * 1000000; // Convert to bits this.chart.setOption(this.option); } } \ No newline at end of file diff --git a/src/rust/lqosd/src/node_manager/js_build/src/graphs/packets_bar.js b/src/rust/lqosd/src/node_manager/js_build/src/graphs/packets_bar.js index 1ae5d46a..36cf57df 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/graphs/packets_bar.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/graphs/packets_bar.js @@ -25,7 +25,7 @@ export class PacketsPerSecondBar extends DashboardGraph { this.option && this.chart.setOption(this.option); } - update(up, down) { + update(down, up) { this.chart.hideLoading(); this.option.series[0].data = [up, down]; this.chart.setOption(this.option); diff --git a/src/rust/lqosd/src/node_manager/js_build/src/graphs/throughput_ring_graph.js b/src/rust/lqosd/src/node_manager/js_build/src/graphs/throughput_ring_graph.js index 474b376f..0a65b7de 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/graphs/throughput_ring_graph.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/graphs/throughput_ring_graph.js @@ -100,10 +100,10 @@ class RingBuffer { } push(shaped, unshaped) { - this.data[this.head][0] = 0.0 - shaped[0]; - this.data[this.head][1] = shaped[1]; - this.data[this.head][2] = 0.0 - unshaped[0]; - this.data[this.head][3] = unshaped[1]; + this.data[this.head][0] = shaped.down; + this.data[this.head][1] = 0.0 - shaped.up; + this.data[this.head][2] = unshaped.down; + this.data[this.head][3] = 0.0 - unshaped.up; this.head += 1; this.head %= this.size; } diff --git a/src/rust/lqosd/src/node_manager/ws/ticker/throughput.rs b/src/rust/lqosd/src/node_manager/ws/ticker/throughput.rs index 14eff9ca..3e83b737 100644 --- a/src/rust/lqosd/src/node_manager/ws/ticker/throughput.rs +++ b/src/rust/lqosd/src/node_manager/ws/ticker/throughput.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use serde_json::json; use lqos_config::load_config; +use lqos_utils::units::DownUpOrder; use crate::node_manager::ws::publish_subscribe::PubSub; use crate::node_manager::ws::published_channels::PublishedChannels; use crate::throughput_tracker::THROUGHPUT_TRACKER; @@ -18,12 +19,12 @@ pub async fn throughput(channels: Arc) { ) }; let max = if let Ok(config) = load_config() { - ( + DownUpOrder::new( config.queues.uplink_bandwidth_mbps, config.queues.downlink_bandwidth_mbps, ) } else { - (0,0) + DownUpOrder::zeroed() }; let bps = json!( {