Skip to content

Commit

Permalink
Telemetry batching and throttling (#412)
Browse files Browse the repository at this point in the history
* Refactored for new batched worker provider

* Skipp callbacks with no telemetry

* Process messages for that remote-clock before any others to avoid race conditions

* Fixing bugs

* Added explanatory comments. Make max batch size and throttle rate configuration

* Removed TODO comment in lieu of a followup ticket

* Make batch configuration explicit in the example

* Tell Istanbul to ignore serialized functions

* Fixing linting errors
  • Loading branch information
akhenry authored Jan 30, 2024
1 parent 5b23f9b commit ef505ad
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 122 deletions.
4 changes: 3 additions & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const config = {
"yamcsUserEndpoint": "http://localhost:9000/yamcs-proxy/api/user/",
"yamcsInstance": "myproject",
"yamcsProcessor": "realtime",
"yamcsFolder": "myproject"
"yamcsFolder": "myproject",
"throttleRate": 1000,
"maxBatchSize": 15
};
const STATUS_STYLES = {
"NO_STATUS": {
Expand Down
5 changes: 4 additions & 1 deletion src/openmct-yamcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ export default function install(configuration) {
openmct.telemetry.addProvider(historicalTelemetryProvider);

const realtimeTelemetryProvider = new RealtimeProvider(
openmct,
configuration.yamcsWebsocketEndpoint,
configuration.yamcsInstance,
configuration.yamcsProcessor
configuration.yamcsProcessor,
configuration.throttleRate,
configuration.maxBatchSize
);
openmct.telemetry.addProvider(realtimeTelemetryProvider);
realtimeTelemetryProvider.connect();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/limit-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default class LimitProvider {
const limits = domainObject.configuration.limits;

return {
limits: async () => limits
limits: () => Promise.resolve(limits)
};
}

Expand Down
Loading

0 comments on commit ef505ad

Please sign in to comment.