From 8e0069312d29cebae24a90ebc6527f31d4761341 Mon Sep 17 00:00:00 2001 From: Michele Di Maria Date: Mon, 25 Feb 2013 23:47:18 +0100 Subject: Update usr/local/www/status_queues.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the Drops issue and adds the Queue length information to the page.  --- usr/local/www/status_queues.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/usr/local/www/status_queues.php b/usr/local/www/status_queues.php index c147a57..e1796a4 100755 --- a/usr/local/www/status_queues.php +++ b/usr/local/www/status_queues.php @@ -50,6 +50,7 @@ header("Pragma: no-cache"); // HTTP/1.0 require("guiconfig.inc"); class QueueStats { public $queuename; + public $queuelength; public $pps; public $bandwidth; public $borrows; @@ -89,15 +90,16 @@ if ($_REQUEST['getactivity']) { } $finscript = ""; foreach($statistics as $q) { - $packet_s = round(200 * (1 - $q->pps / $bigger_packets), 0); + $packet_s = round(150 * (1 - $q->pps / $bigger_packets), 0); if ($packet_s < 0) {$packet_s = 0;} $finscript .= "jQuery('#queue{$q->queuename}widthb').width('{$packet_s}');"; - $finscript .= "jQuery('#queue{$q->queuename}widtha').width('" . (200 - $packet_s) . "');"; + $finscript .= "jQuery('#queue{$q->queuename}widtha').width('" . (150 - $packet_s) . "');"; $finscript .= "jQuery('#queue{$q->queuename}pps').val('" . number_format($q->pps,1) . "');"; $finscript .= "jQuery('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');"; $finscript .= "jQuery('#queue{$q->queuename}borrows').val('{$q->borrows}');"; $finscript .= "jQuery('#queue{$q->queuename}suspends').val('{$q->suspends}');"; $finscript .= "jQuery('#queue{$q->queuename}drops').val('{$q->drops}');"; + $finscript .= "jQuery('#queue{$q->queuename}length').val('{$q->queuelength}');"; } unset($statistics, $altqstats); header("Content-type: text/javascript"); @@ -150,6 +152,7 @@ if(!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) < + "; + echo ""; echo ""; echo ""; - echo ""; + echo ""; echo " "; if (is_array($q['queue'])) { - echo "+/-"; + echo "+/- "; } - echo ""; - echo ""; + echo " "; + echo ""; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; ?> 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['drops']); + $current->drops = intval($xml['droppedpkts']); if (is_array($xml['queue'])) { foreach($xml['queue'] as $q) { -- cgit v1.1