Skip to content

Comments

feat: Add debounce to the notification on data-lake list update#2379

Merged
rafaellehmkuhl merged 1 commit intobluerobotics:masterfrom
rafaellehmkuhl:add-debounce-data-lake-vars-info-listeners
Jan 28, 2026
Merged

feat: Add debounce to the notification on data-lake list update#2379
rafaellehmkuhl merged 1 commit intobluerobotics:masterfrom
rafaellehmkuhl:add-debounce-data-lake-vars-info-listeners

Conversation

@rafaellehmkuhl
Copy link
Member

Those listening to updates in the data-lake variables list need to know it updated, and which are the new values, but when hundreds of values are being added at once (which happens during startup and vehicle connection) they don't need to be updated hundreds of times.

This update makes it so the listeners are notified only if no updates are made to the list for at least 1 second.

Reduces from 40 to 2 notifications per Plotter, and from 40 to 2 notifications per VeryGenericIndicator.

In my default profile/view (5 Plotters and 2 VGIs) it reduced the number of updates from 280 to 14.


// Debounce timer for variable info change notifications
let notifyInfoListenersTimeout: ReturnType<typeof setTimeout> | null = null
const NOTIFY_INFO_DEBOUNCE_MS = 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable name should be in camelCase

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed!

Those listening to updates in the data-lake variables list need to know it updated, and which are the new values, but when hundreds of values are being added at once, which happens during startup and during vehicle connection, they don't need to be updated hundreds of times.

This update makes it so the listeners are notified only if no updates are made to the list for at least 1 second.

Reduces from 40 to 2 notifications per Plotter, and from 40 to 2 notifications per VeryGenericIndicator.
@rafaellehmkuhl rafaellehmkuhl force-pushed the add-debounce-data-lake-vars-info-listeners branch from 83a6bb4 to 906f56f Compare January 28, 2026 12:33
@rafaellehmkuhl rafaellehmkuhl merged commit a1a8223 into bluerobotics:master Jan 28, 2026
11 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the add-debounce-data-lake-vars-info-listeners branch January 28, 2026 13:20
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

Successfully merging this pull request may close these issues.

2 participants