Revision 6a153733
Added by Scott Ullrich over 20 years ago
etc/inc/pfsense-utils.inc | ||
---|---|---|
559 | 559 |
* is queuename|qlength|measured_packets |
560 | 560 |
* NOTE: this commandt takes 5 seconds to run |
561 | 561 |
*/ |
562 |
function gather_altq_queue_stats() { |
|
562 |
function gather_altq_queue_stats($dont_return_root_queues) {
|
|
563 | 563 |
mwexec("/usr/bin/killall pfctl"); |
564 | 564 |
$stats = `/sbin/pfctl -vvsq & sleep 5;killall pfctl 2>/dev/null`; |
565 | 565 |
$stats_array = split("\n", $stats); |
... | ... | |
571 | 571 |
$speed = $match_array[1][0]; |
572 | 572 |
if (preg_match_all("/measured:\s+(.*)packets/",$stats_line,$match_array)) { |
573 | 573 |
$measured = $match_array[1][0]; |
574 |
if(stristr($queue_name,"root_") == false) |
|
575 |
array_push($queue_stats, "{$queue_name}|{$speed}|{$measured}"); |
|
574 |
if($dont_return_root_queues == true) |
|
575 |
if(stristr($queue_name,"root_") == false) |
|
576 |
array_push($queue_stats, "{$queue_name}|{$speed}|{$measured}"); |
|
576 | 577 |
} |
577 | 578 |
} |
578 | 579 |
return $queue_stats; |
usr/local/www/firewall_shaper_queues.php | ||
---|---|---|
193 | 193 |
$counter = 0; |
194 | 194 |
While(!Connection_Aborted()) { |
195 | 195 |
|
196 |
$stats_array = gather_altq_queue_stats(); |
|
196 |
$stats_array = gather_altq_queue_stats(true);
|
|
197 | 197 |
|
198 | 198 |
/* calculate total packets being moved through all queues. */ |
199 | 199 |
$total_packets_s = 0; |
Also available in: Unified diff
Add a flag to gather_altq_queue_stats to allow the returning of the root queues