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

Update sensor status per Ajax call #1344

Open
nhoening opened this issue Feb 26, 2025 · 2 comments
Open

Update sensor status per Ajax call #1344

nhoening opened this issue Feb 26, 2025 · 2 comments
Assignees

Comments

@nhoening
Copy link
Contributor

nhoening commented Feb 26, 2025

The status page becomes rather slow when we load all of the states at once, even timing out.

Better to load the status table empty at first and then load status per sensor one by one, and the jobs table in one go.

  • new endpoint /sensors/ID/status, with existing logic moved there
  • new endpoint /assets/ID/jobs, with existing logic moved there
  • make the page load the sensor states one by one (with parallel Ajax calls)
  • add a refresh button/link next to each sensor, so users don't have to refresh the whole page
  • make the page re-load the jobs regularly from AJAX, as well (each 30 seconds)
  • also a refresh link/button for the jobs table as a whole
  • display next to each sensor and next to the jobs table how long ago the last update was
@nhoening
Copy link
Contributor Author

nhoening commented Mar 3, 2025

The sensors API would get a new endpoint (/status) with roughly this content:

sensor_statuses = get_statuses(
     sensor=sensor,
     now=now,
)

This is in data/services/sensors/build_sensor_status_data(), which should only collect the information for the rest of the table (and be renamed a bit).

@nhoening
Copy link
Contributor Author

nhoening commented Mar 3, 2025

Branch off from status-page-by-source, please, until that is merged.

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

No branches or pull requests

2 participants