Project

General

Profile

Actions

Bug #9917

closed

Widget Refresh Logic Flawed

Added by Christopher Embry over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Dashboard
Target version:
-
Start date:
11/23/2019
Due date:
% Done:

0%

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

Description

Hello team,

I have forked pfSense and resolved this in a feature branch, but need to have a redmine issue for reference when submitting my pull request. Here's a sort of write-up of the issue, and what's been done to resolve it.

---
[ /usr/local/www/index.php ]
  1. The function `executewidget()` is called every second.
  2. `freq` is defined as the desired number of seconds between each execution of the `ajaxidx`th widget.
  3. If `ajaxcntr % freq` is equal to 0, the `ajaxidx`th widget will run.
  4. At the end of `executewidget()`, `ajaxidx` is increased.
    • If `ajaxidx` is greater than the number of widgets, it is reset to 0 and `ajaxcntr` is also increased. If `ajaxcntr` is greater than 4096, is it reset to 0.

The end result is that each call of `executewidget()` takes `n` seconds to run, where `n` is the number of widgets on the dashboard, and each widget will only execute every `t` times `executewidget()` is run, resulting in an actual update time of `n * t` seconds.

Example, for further illustration:
  • Suppose that there are 8 widgets present on the pfSense dashboard, and the Firewall Logs widget is configured to have an "Update interval" of 10 seconds.
  • A single call of `executewidget()` takes 8 seconds (1 second per widget * 8 widgets total), and Firewall Logs only refreshes every 10 times `updatewidget()` is called.
  • Thus Firewall Logs only refreshes every 8 * 10 seconds, or 80 seconds. This is a bug, and incorrect behavior.
  • This will be fixed through the use of a single `for` loop, each time `executewidget()` is called, that "passes over" all widgets and decides on a per-widget basis if they should be executed (based on `ajaxcntr`).
    ---

Regards,
- NobleKangaroo

Actions #1

Updated by Jim Pingle over 4 years ago

  • Category set to Web Interface
  • Status changed from New to Pull Request Review
  • Assignee set to Anonymous
  • Target version set to 2.5.0
  • Affected Version set to All
  • Affected Architecture All added
  • Affected Architecture deleted ()
Actions #3

Updated by Anonymous almost 4 years ago

  • Status changed from Pull Request Review to Closed
Actions #4

Updated by Jim Pingle over 3 years ago

  • Category changed from Web Interface to Dashboard
Actions #5

Updated by Jim Pingle over 3 years ago

  • Target version deleted (2.5.0)
Actions

Also available in: Atom PDF