Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status_queues, provide 'realtime' statistics #3792

Merged

Conversation

PiBa-NL
Copy link
Contributor

@PiBa-NL PiBa-NL commented Jul 30, 2017

status_queues, provide 'realtime' statistics
-retrieve 'current' numbers from pfSense

not using qstats provides the following advantages:
-no long lag which requires 18 updates to get 90% accurate values on screen
-showing queue's in 2 browsers does not show half the value

Copy link
Contributor

@jim-p jim-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to look/work well, just a couple minor tweaks I've mentioned inline, thanks!

// in its current implementation this php function does the job for now..
$result = array();
$result['timestamp'] = gettimeofday(true);
$r = exec("pfctl -s queue -v", $output, $ret);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use the full path for /sbin/pfctl

//required for convert_real_interface_to_friendly_interface_name() to get altq interface name..
include_once("interfaces.inc");

function get_queue_stats() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function is used in multiple files, is there any particular reason it needs to be here instead of in a library file like /etc/inc/shaper.inc?

}

$(document).ready(function() {
setTimeout(getqueueactivity, 150);
});
});

function formatSpeedBits(speed) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be in /etc/inc/util.inc next to format_bytes() and format_number().

Copy link
Contributor Author

@PiBa-NL PiBa-NL Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems difficult to move.. <?=gettext("Kbps"); ?> doesnt work in pfSenseHelper.js as thats not parsed through php.. so maybe this is the best spot after all. even though it does duplicate javascript code thats also in graph.php. not sure what would be the proper way do de-duplicate this code..

@rbgarga rbgarga removed the CLA label Sep 22, 2017
-retrieve 'current' numbers from pfSense

not using qstats provides the following advantages:
-no long lag which requires 18 updates to get 90% accurate values on screen
-showing queue's in 2 browsers does not show half the value

status_queues, altq codel queue does not show queues, and when cbq without options doesn't tell its 'type' on the queue line then still parse its borrows and suspends

status_queues, move function get_queue_stats() to shaper.inc
@PiBa-NL PiBa-NL force-pushed the 20170731-status_queues-realtime branch from 2c4134c to 0e2bed2 Compare November 5, 2017 00:31
@PiBa-NL
Copy link
Contributor Author

PiBa-NL commented Nov 5, 2017

@jim-p @rbgarga @sbeaver-netgate , i have rebased this PR, can you guy's review and pull it please? thanks.

@jim-p
Copy link
Contributor

jim-p commented Dec 11, 2017

In an effort to improve the tracking of changes and bug/feature requests, we have decided to require an entry on the pfSense Redmine issue tracker associated with every pull request, and likewise the Redmine entry should also have a link back to the pull request.

If you could, please associate this PR to a Redmine issue either by locating an existing issue at https://redmine.pfsense.org or by creating a new issue. Add a link to the Redmine issue that points to this PR, and also add a link on the PR to the Redmine issue.

For more information, see https://doc.pfsense.org/index.php/Submitting_a_Pull_Request_via_Github

Thanks!

@jim-p
Copy link
Contributor

jim-p commented Dec 11, 2017

Redmine issue: https://redmine.pfsense.org/issues/8185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants