akhenry / openmct-yamcs

Open MCT YAMCS plugin
14 stars 9 forks source link

Improved buffering #477

Closed akhenry closed 2 months ago

akhenry commented 2 months ago

NOTE: https://github.com/nasa/openmct/pull/7837 will need be merged before this.

  1. Merge https://github.com/nasa/openmct/pull/7837
  2. Update package.json to point it to npm latest

Adapts the openmct-yamcs plugin for the API changes in https://github.com/nasa/openmct/issues/7838

Describe your changes:

All Submissions:

Author Checklist

Reviewer Checklist

akhenry commented 2 months ago

Test was failing due to genuine bug introduced in this refactor of telemetry batching. Previously housekeeping WebSocket messages bypassed the throttling / batching process altogether, which meant that important housekeeping messages (such as those that go back and forth when setting up a telemetry subscription) were never dropped.

With this refactor the WebSocket buffering code was greatly simplified, removing the special handling for housekeeping messages. One of the automated tests triggered an edge case where throttling is induced during the initial handshaking that takes place when initializing a subscription, causing some subscriptions to never get established properly. Luckily our tests caught this.

I made a small change to the telemetry throttling implementation so that instead of throttling all messages when the UI thread is overloaded, a regex can optionally be supplied that is used to decided whether a given message should be throttled. This allows us to avoid culling housekeeping messages.