diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-03-05 22:03:42 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-03-05 22:03:42 +0000 |
commit | b45ea70973d1c11cbc347aacf839f55a6d3694f5 (patch) | |
tree | 3f810bab63ffeee5c85179dc1235a93a92bfd983 /etc | |
parent | 257306c0e0d4e44480258c32a95bfecb9f9597fd (diff) | |
download | pfsense-b45ea70973d1c11cbc347aacf839f55a6d3694f5.zip pfsense-b45ea70973d1c11cbc347aacf839f55a6d3694f5.tar.gz |
Add queue graph support.
TODO: Show parent / child relationship and graph upon the total of the parent/child.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 063f5ef..a2730e7 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -554,4 +554,29 @@ function resync_all_package_configs_bootup($show_message) { } } +/* + * gather_altq_queue_stats(): gater alq queue stats and return an array that + * is queuename|qlength|measured_packets + * NOTE: this commandt takes 5 seconds to run + */ +function gather_altq_queue_stats() { + $stats = `/sbin/pfctl -vvsq & sleep 5;killall pfctl 2>/dev/null`; + $stats_array = split("\n", $stats); + $queue_stats = array(); + foreach ($stats_array as $stats_line) { + if (preg_match_all("/queue\s+(\w+)\s+/",$stats_line,$match_array)) + $queue_name = $match_array[1][0]; + #\n+\/\n+ + if (preg_match_all("/qlength:\s+([0-99999]\/\s+[0-99999])\s+]/",$stats_line,$match_array)) + $qlength = $match_array[1][0]; + if (preg_match_all("/measured:\s+(.*)packets/",$stats_line,$match_array)) { + $measured = $match_array[1][0]; + if(stristr($queue_name,"root_") == false) + array_push($queue_stats, "{$queue_name}|{$qlength}|{$measured}"); + } + } + return $queue_stats; +} + + ?>
\ No newline at end of file |