Root queue in "Status: Traffic shaper: Queues" is showing double values
-
Hi All,
I have two systems where I'm currently testing the traffic shaper with CBQ.
It works well but the status view is always shoing a number for Bandwidth and PPS which is the exact double from what it should be. The sums for the other lines are correct. Only bandwith and PPS are a double of the real sum.
Any idea how to fix that?Attached are the screenshots from the two different test systems.
Thanks,
Mike
-
In the meantime I found a workaround which makes the PPS and the Bandwidth column showing the correct values.
status_queues.php is reading from a file called /tmp/qstats
This /tmp/qstats file is already having the sum of each child queues for the root queue for bandwidth and PPS. But the PHP code still adds the amount of all child queues to it which is causing the doubles.I did a change in status_queues.php to fix it. I commented two lines (highlighted in red):
function statsQueues($xml){
global $statistics;$current = new QueueStats();
$child = new QueueStats();
$current->queuename = $xml['name'] . $xml['interface'];
$current->queuelength = $xml['qlength'];
$current->pps = $xml['measured'];
$current->bandwidth = $xml['measuredspeedint'];
$current->borrows = intval($xml['borrows']);
$current->suspends = intval($xml['suspends']);
$current->drops = intval($xml['droppedpkts']);
if (is_array($xml['queue'])) {
foreach($xml['queue'] as $q) {
$child = statsQueues($q);
/* $current->pps += $child->pps;
$current->bandwidth += $child->bandwidth; */
$current->borrows += $child->borrows;
$current->suspends += $child->suspends;
$current->drops += $child->drops;
}
}
unset($child);
$statistics[] = $current;
return $current;
}