1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-20 00:26:04 -05:00

Added acks with messages graphs

This commit is contained in:
Hemna 2021-03-26 11:13:32 -04:00
parent c7d10f53a3
commit f10372b320

View File

@ -23,7 +23,8 @@
green: 'rgb(26, 181, 77)', green: 'rgb(26, 181, 77)',
blue: 'rgb(54, 162, 235)', blue: 'rgb(54, 162, 235)',
purple: 'rgb(153, 102, 255)', purple: 'rgb(153, 102, 255)',
grey: 'rgb(201, 203, 207)' grey: 'rgb(201, 203, 207)',
black: 'rgb(0, 0, 0)'
}; };
function start_charts() { function start_charts() {
@ -77,6 +78,16 @@
label: 'Messages Recieved', label: 'Messages Recieved',
borderColor: window.chartColors.yellow, borderColor: window.chartColors.yellow,
data: [], data: [],
},
{
label: 'Ack Sent',
borderColor: window.chartColors.purple,
data: [],
},
{
label: 'Ack Recieved',
borderColor: window.chartColors.black,
data: [],
}], }],
}, },
options: { options: {
@ -116,6 +127,14 @@
chart.data.datasets[1].data.push(second); chart.data.datasets[1].data.push(second);
chart.update(); chart.update();
} }
function updateQuadData(chart, label, first, second, third, fourth) {
chart.data.labels.push(label);
chart.data.datasets[0].data.push(first);
chart.data.datasets[1].data.push(second);
chart.data.datasets[2].data.push(third);
chart.data.datasets[3].data.push(fourth);
chart.update();
}
function update_stats( data ) { function update_stats( data ) {
$("#version").text( data["version"] ); $("#version").text( data["version"] );
@ -125,7 +144,7 @@
//$("#jsonstats").effect("highlight", {color: "#333333"}, 800); //$("#jsonstats").effect("highlight", {color: "#333333"}, 800);
//console.log(data); //console.log(data);
updateDualData(memory_chart, data["time"], data["memory_peak"], data["memory_current"]); updateDualData(memory_chart, data["time"], data["memory_peak"], data["memory_current"]);
updateDualData(message_chart, data["time"], data["stats"]["messages"]["sent"], data["stats"]["messages"]["recieved"]); updateQuadData(message_chart, data["time"], data["stats"]["messages"]["sent"], data["stats"]["messages"]["recieved"], data["stats"]["messages"]["ack_sent"], data["stats"]["messages"]["ack_recieved"]);
} }
function start_update() { function start_update() {