Project

General

Profile

Actions

Bug #15725

closed

Dashboard widgets refresh at unintended intervals

Added by GChuf 6 about 1 month ago. Updated 8 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Dashboard
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
24.11
Release Notes:
Default
Affected Version:
All
Affected Architecture:
All

Description

Here's the PR:
https://github.com/pfsense/pfsense/pull/4697

Current problem:
the widget system does not work as intended - the "interval" is multiplied by the number of active widgets, and so an interval of "1" (meant to be multiplied by 1000 milliseconds) becomes [number of active widgets] seconds instead of 1 second.
Mutex can also block the execution of "refresh" of a widget, resulting in refresh of less widget per "loop".
While testing, mutex was active for about 50% of the time, and so blocked about 50% of the refreshes.
If I remove the mutex and let all the calls run normally, the results are much more predictable.

In the below scenarios, 5 widgets are used: stats, thermal, disk, interfaces (interfaces.php), traffic (ifstats.php).
The refresh intervals are:
stats, disk and interfaces: 1
traffic: 2
thermal: 5

Current behavior in the below picture (notice the irregularity in the calls)

Traffic widget seems to be refreshed as expected, "stats" widget gets called every 5 seconds instead of 1, and thermal widget only gets called once in the time window below.

Behavior after the fix - much more predictable:

1st run:
stats, disk, interfaces

2nd run:
stats, disk, interfaces, traffic

3rd:
stats, disk, interfaces

4th:
stats, disk, interfaces, traffic

5th:
stats, disk, interfaces, thermal

...

10th:
stats, disk, interfaces, traffic, thermal

This means that the "stats" widget gets called every second now, as the default multiplier is 1. I think a multiplier of 5 would be a better starting point, hence the second commit.


Files

getstats_only.png (22.8 KB) getstats_only.png GChuf 6, 09/14/2024 10:36 PM
mutex_output.png (3.44 KB) mutex_output.png GChuf 6, 09/14/2024 10:36 PM
networ_after.png (180 KB) networ_after.png GChuf 6, 09/14/2024 10:36 PM
network_original.png (133 KB) network_original.png GChuf 6, 09/14/2024 10:36 PM

Related issues

Related to Bug #15373: Firewall Logs Dashboard widget update interval does not behave as expectedResolved

Actions
Actions

Also available in: Atom PDF