Project

General

Profile

Feature #7016

system_information_widget.php - Indicate adaptive state timeout status when active

Added by Jim Pingle 11 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Dashboard
Target version:
Start date:
12/16/2016
Due date:
% Done:

0%


Description

It would be helpful to show the user that pf has enabled adaptive state timeout scaling when it kicks in.

Some sample code to calculate the scaling factor and to flag when it is active:

if (isset($config['system']['adaptivestart']) and $config['system']['adaptivestart'] > 0) {
    $adaptivestart = "{$config['system']['adaptivestart']}";
} else {
    $adaptivestart = intval($maxstates * 0.6);
}
if (isset($config['system']['adaptiveend']) and $config['system']['adaptiveend'] > 0) {
    $adaptiveend = "{$config['system']['adaptiveend']}";
} else {
    $adaptiveend = intval($maxstates * 1.2);
}
$adaptive_text = "";
if ($curentries > $adaptivestart) {
    $scalingfactor = round(($adaptiveend - $curentries) / ($adaptiveend - $adaptivestart) * 100, 0);
    $adaptive_text = "Adaptive state handling enabled, state timeouts reduced by {$scalingfactor}%)";
}

Main problem is formatting in the widget, getting it to a place where it's clear what it is without cluttering. Bonus points for changing the color of the progress bar to yellow when this is active.

Also available in: Atom PDF