mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add Cake Queue Length
This commit is contained in:
parent
bfa58c4541
commit
1459d624c7
@ -11,6 +11,7 @@ import {FlowsSankey} from "./graphs/flow_sankey";
|
|||||||
import {subscribeWS} from "./pubsub/ws";
|
import {subscribeWS} from "./pubsub/ws";
|
||||||
import {CakeBacklog} from "./graphs/cake_backlog";
|
import {CakeBacklog} from "./graphs/cake_backlog";
|
||||||
import {CakeDelays} from "./graphs/cake_delays";
|
import {CakeDelays} from "./graphs/cake_delays";
|
||||||
|
import {CakeQueueLength} from "./graphs/cake_queue_length";
|
||||||
|
|
||||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||||
get: (searchParams, prop) => searchParams.get(prop),
|
get: (searchParams, prop) => searchParams.get(prop),
|
||||||
@ -560,6 +561,7 @@ function onTreeEvent(msg) {
|
|||||||
function subscribeToCake() {
|
function subscribeToCake() {
|
||||||
let backlogGraph = new CakeBacklog("cakeBacklog");
|
let backlogGraph = new CakeBacklog("cakeBacklog");
|
||||||
let delaysGraph = new CakeDelays("cakeDelays");
|
let delaysGraph = new CakeDelays("cakeDelays");
|
||||||
|
let queueLength = new CakeQueueLength("cakeQueueLength");
|
||||||
channelLink = new DirectChannel({
|
channelLink = new DirectChannel({
|
||||||
CakeWatcher: {
|
CakeWatcher: {
|
||||||
circuit: circuit_id
|
circuit: circuit_id
|
||||||
@ -573,6 +575,8 @@ function subscribeToCake() {
|
|||||||
backlogGraph.chart.resize();
|
backlogGraph.chart.resize();
|
||||||
delaysGraph.update(msg);
|
delaysGraph.update(msg);
|
||||||
delaysGraph.chart.resize();
|
delaysGraph.chart.resize();
|
||||||
|
queueLength.update(msg);
|
||||||
|
queueLength.chart.resize();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,88 @@
|
|||||||
|
import {DashboardGraph} from "./dashboard_graph";
|
||||||
|
import {scaleNumber} from "../helpers/scaling";
|
||||||
|
|
||||||
|
export class CakeQueueLength extends DashboardGraph {
|
||||||
|
constructor(id) {
|
||||||
|
super(id);
|
||||||
|
|
||||||
|
let xaxis = [];
|
||||||
|
for (let i=0; i<600; i++) {
|
||||||
|
xaxis.push(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.option = {
|
||||||
|
title: {
|
||||||
|
text: "Queue Length",
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
orient: "horizontal",
|
||||||
|
right: 10,
|
||||||
|
top: "bottom",
|
||||||
|
selectMode: false,
|
||||||
|
textStyle: {
|
||||||
|
color: '#aaa'
|
||||||
|
},
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
name: "Queue Length",
|
||||||
|
icon: 'circle',
|
||||||
|
itemStyle: {
|
||||||
|
color: "orange"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: xaxis,
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: 'Queue Length',
|
||||||
|
data: [],
|
||||||
|
type: 'line',
|
||||||
|
lineStyle: {
|
||||||
|
color: 'orange',
|
||||||
|
},
|
||||||
|
symbol: 'none',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Queue Length Up',
|
||||||
|
data: [],
|
||||||
|
type: 'line',
|
||||||
|
lineStyle: {
|
||||||
|
color: 'orange',
|
||||||
|
},
|
||||||
|
symbol: 'none',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item',
|
||||||
|
},
|
||||||
|
animation: false,
|
||||||
|
}
|
||||||
|
this.option && this.chart.setOption(this.option);
|
||||||
|
}
|
||||||
|
|
||||||
|
update(msg) {
|
||||||
|
this.chart.hideLoading();
|
||||||
|
|
||||||
|
this.option.series[0].data = [];
|
||||||
|
this.option.series[1].data = [];
|
||||||
|
|
||||||
|
//console.log(msg);
|
||||||
|
for (let i=msg.history_head; i<600; i++) {
|
||||||
|
this.option.series[0].data.push(msg.history[i][0].qlen);
|
||||||
|
this.option.series[1].data.push(0 - msg.history[i][1].qlen);
|
||||||
|
}
|
||||||
|
for (let i=0; i<msg.history_head; i++) {
|
||||||
|
this.option.series[0].data.push(msg.history[i][0].qlen);
|
||||||
|
this.option.series[1].data.push(0 - msg.history[i][1].qlen);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chart.setOption(this.option);
|
||||||
|
}
|
||||||
|
}
|
@ -90,6 +90,9 @@
|
|||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div id="cakeDelays" style="height: 250px"></div>
|
<div id="cakeDelays" style="height: 250px"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<div id="cakeQueueLength" style="height: 250px"></div>
|
||||||
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
Queue Memory: <span id="cakeQueueMemory">?</span>
|
Queue Memory: <span id="cakeQueueMemory">?</span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user